@@ -294,6 +294,9 @@ discard block |
||
| 294 | 294 | return $this->_options; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | + /** |
|
| 298 | + * @param string $option_name |
|
| 299 | + */ |
|
| 297 | 300 | public function get_option( $option_name ) { |
| 298 | 301 | $options = $this->get_options(); |
| 299 | 302 | |
@@ -1428,6 +1431,8 @@ discard block |
||
| 1428 | 1431 | * Enqueues assets needed to do async loading of related posts. |
| 1429 | 1432 | * |
| 1430 | 1433 | * @uses wp_enqueue_script, wp_enqueue_style, plugins_url |
| 1434 | + * @param boolean $script |
|
| 1435 | + * @param boolean $style |
|
| 1431 | 1436 | * @return null |
| 1432 | 1437 | */ |
| 1433 | 1438 | protected function _enqueue_assets( $script, $style ) { |
@@ -31,6 +31,9 @@ discard block |
||
| 31 | 31 | public $did_output = false; |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | + * @param string $method |
|
| 35 | + * @param string $url |
|
| 36 | + * @param string $post_body |
|
| 34 | 37 | * @return WPCOM_JSON_API instance |
| 35 | 38 | */ |
| 36 | 39 | static function init( $method = null, $url = null, $post_body = null ) { |
@@ -332,6 +335,9 @@ discard block |
||
| 332 | 335 | return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); |
| 333 | 336 | } |
| 334 | 337 | |
| 338 | + /** |
|
| 339 | + * @param integer $status_code |
|
| 340 | + */ |
|
| 335 | 341 | function output_early( $status_code, $response = null, $content_type = 'application/json' ) { |
| 336 | 342 | $exit = $this->exit; |
| 337 | 343 | $this->exit = false; |
@@ -526,6 +532,9 @@ discard block |
||
| 526 | 532 | return json_encode( $data ); |
| 527 | 533 | } |
| 528 | 534 | |
| 535 | + /** |
|
| 536 | + * @param string $needle |
|
| 537 | + */ |
|
| 529 | 538 | function ends_with( $haystack, $needle ) { |
| 530 | 539 | return $needle === substr( $haystack, -strlen( $needle ) ); |
| 531 | 540 | } |
@@ -553,6 +562,10 @@ discard block |
||
| 553 | 562 | } |
| 554 | 563 | |
| 555 | 564 | // Returns true if the specified blog ID is a restricted blog |
| 565 | + |
|
| 566 | + /** |
|
| 567 | + * @param integer $blog_id |
|
| 568 | + */ |
|
| 556 | 569 | function is_restricted_blog( $blog_id ) { |
| 557 | 570 | /** |
| 558 | 571 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |