@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | /** |
| 138 | 138 | * Plugin options getter |
| 139 | 139 | * |
| 140 | - * @param string|array $option Option name |
|
| 141 | - * @param mixed $default Default value |
|
| 140 | + * @param string $option Option name |
|
| 141 | + * @param string $default Default value |
|
| 142 | 142 | * |
| 143 | 143 | * @return mixed Option value |
| 144 | 144 | */ |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * |
| 165 | 165 | * @param string $url |
| 166 | 166 | * |
| 167 | - * @return boolean |
|
| 167 | + * @return integer |
|
| 168 | 168 | */ |
| 169 | 169 | function soundcloud_url_has_tracklist( $url ) { |
| 170 | 170 | return preg_match( '/^(.+?)\/(sets|groups|playlists)\/(.+?)$/', $url ); |
@@ -132,6 +132,9 @@ |
||
| 132 | 132 | return self::json_api( self::get_post_api_url( $post_id) ); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | + /** |
|
| 136 | + * @param string $url |
|
| 137 | + */ |
|
| 135 | 138 | static function json_api( $url, $method = 'GET' ) { |
| 136 | 139 | |
| 137 | 140 | require_once JETPACK__PLUGIN_DIR . 'class.json-api.php'; |
@@ -29,6 +29,8 @@ discard block |
||
| 29 | 29 | public $did_output = false; |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | + * @param string $method |
|
| 33 | + * @param string $post_body |
|
| 32 | 34 | * @return WPCOM_JSON_API instance |
| 33 | 35 | */ |
| 34 | 36 | static function init( $method = null, $url = null, $post_body = null, $return_new = false ) { |
@@ -333,6 +335,9 @@ discard block |
||
| 333 | 335 | return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); |
| 334 | 336 | } |
| 335 | 337 | |
| 338 | + /** |
|
| 339 | + * @param integer $status_code |
|
| 340 | + */ |
|
| 336 | 341 | function output_early( $status_code, $response = null, $content_type = 'application/json' ) { |
| 337 | 342 | $exit = $this->exit; |
| 338 | 343 | $this->exit = false; |
@@ -527,6 +532,9 @@ discard block |
||
| 527 | 532 | return json_encode( $data ); |
| 528 | 533 | } |
| 529 | 534 | |
| 535 | + /** |
|
| 536 | + * @param string $needle |
|
| 537 | + */ |
|
| 530 | 538 | function ends_with( $haystack, $needle ) { |
| 531 | 539 | return $needle === substr( $haystack, -strlen( $needle ) ); |
| 532 | 540 | } |
@@ -554,6 +562,10 @@ discard block |
||
| 554 | 562 | } |
| 555 | 563 | |
| 556 | 564 | // Returns true if the specified blog ID is a restricted blog |
| 565 | + |
|
| 566 | + /** |
|
| 567 | + * @param integer $blog_id |
|
| 568 | + */ |
|
| 557 | 569 | function is_restricted_blog( $blog_id ) { |
| 558 | 570 | /** |
| 559 | 571 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |
@@ -617,6 +629,7 @@ discard block |
||
| 617 | 629 | * The result is always output, never returned. |
| 618 | 630 | * |
| 619 | 631 | * @param string|null $error_code. Call with string to start the trapping. Call with null to stop. |
| 632 | + * @param string $error_code |
|
| 620 | 633 | */ |
| 621 | 634 | function trap_wp_die( $error_code = null ) { |
| 622 | 635 | // Stop trapping |
@@ -70,7 +70,6 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * @param string $file __FILE__ |
| 73 | - * @param string $option, Option name to sync |
|
| 74 | 73 | * @param string $option ... |
| 75 | 74 | */ |
| 76 | 75 | static function sync_options( $file, $option /*, $option, ... */ ) { |
@@ -81,8 +80,6 @@ discard block |
||
| 81 | 80 | } |
| 82 | 81 | /** |
| 83 | 82 | * @param string $file __FILE__ |
| 84 | - * @param string $option, Option name to sync |
|
| 85 | - * @param string $option ... |
|
| 86 | 83 | */ |
| 87 | 84 | static function sync_constant( $file, $constant ) { |
| 88 | 85 | if ( is_network_admin() ) return; |
@@ -301,6 +298,9 @@ discard block |
||
| 301 | 298 | return $this->register( 'post', $id, $settings ); |
| 302 | 299 | } |
| 303 | 300 | |
| 301 | + /** |
|
| 302 | + * @param string $to_sync |
|
| 303 | + */ |
|
| 304 | 304 | static function trigger_sync( $to_sync ) { |
| 305 | 305 | $jetpack = Jetpack::init(); |
| 306 | 306 | if ( ! $jetpack->sync->sync ) { |
@@ -387,6 +387,9 @@ discard block |
||
| 387 | 387 | $this->transition_post_status_action( 'delete', $post->post_status, $post ); |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | + /** |
|
| 391 | + * @param string $new_status |
|
| 392 | + */ |
|
| 390 | 393 | function transition_post_status_action( $new_status, $old_status, $post ) { |
| 391 | 394 | $sync = $this->get_post_sync_operation( $new_status, $old_status, $post, $this->sync_conditions['posts'] ); |
| 392 | 395 | if ( !$sync ) { |
@@ -771,6 +774,11 @@ discard block |
||
| 771 | 774 | /* Options Sync */ |
| 772 | 775 | |
| 773 | 776 | /* Ah... so much simpler than Posts and Comments :) */ |
| 777 | + |
|
| 778 | + /** |
|
| 779 | + * @param string $file |
|
| 780 | + * @param string $option |
|
| 781 | + */ |
|
| 774 | 782 | function options( $file, $option /*, $option, ... */ ) { |
| 775 | 783 | $options = func_get_args(); |
| 776 | 784 | $file = array_shift( $options ); |
@@ -878,6 +886,7 @@ discard block |
||
| 878 | 886 | |
| 879 | 887 | /** |
| 880 | 888 | * Returns default values of Constants |
| 889 | + * @param string $constant |
|
| 881 | 890 | */ |
| 882 | 891 | function default_constant( $constant ) { |
| 883 | 892 | switch( $constant ) { |