@@ -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 ); |
@@ -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 |
@@ -59,9 +59,7 @@ |
||
| 59 | 59 | * Get individual setting |
| 60 | 60 | * |
| 61 | 61 | * @param sting $name |
| 62 | - * @param string $type |
|
| 63 | 62 | * @param string or array $callback |
| 64 | - * @param boolean $is_constant |
|
| 65 | 63 | * @return value of the setting |
| 66 | 64 | */ |
| 67 | 65 | static function get( $name ) { |
@@ -2,6 +2,9 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | class Jetpack_Sync_Utils { |
| 4 | 4 | |
| 5 | + /** |
|
| 6 | + * @param string $check_sum_id |
|
| 7 | + */ |
|
| 5 | 8 | static function sync( $check_sum_id, $values ) { |
| 6 | 9 | $current_check_sum = self::get_check_sum( $values ); |
| 7 | 10 | if ( Jetpack_Options::get_option( $check_sum_id ) !== $current_check_sum ) { |
@@ -20,6 +23,9 @@ discard block |
||
| 20 | 23 | return crc32( self::get_query_string( $values ) ); |
| 21 | 24 | } |
| 22 | 25 | |
| 26 | + /** |
|
| 27 | + * @return string |
|
| 28 | + */ |
|
| 23 | 29 | static function get_query_string( $values ) { |
| 24 | 30 | return build_query( $values ); |
| 25 | 31 | } |
@@ -88,8 +88,6 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * @param string $file __FILE__ |
| 91 | - * @param string $option , Option name to sync |
|
| 92 | - * @param string $option ... |
|
| 93 | 91 | */ |
| 94 | 92 | static function sync_constant( $file, $constant ) { |
| 95 | 93 | if ( is_network_admin() ) { |
@@ -158,6 +156,9 @@ discard block |
||
| 158 | 156 | return true; |
| 159 | 157 | } |
| 160 | 158 | |
| 159 | + /** |
|
| 160 | + * @param string $to_sync |
|
| 161 | + */ |
|
| 161 | 162 | static function trigger_sync( $to_sync ) { |
| 162 | 163 | $jetpack_sync = Jetpack::init()->sync; |
| 163 | 164 | if ( ! isset( $jetpack_sync->sync ) && empty( $jetpack_sync->sync ) ) { |
@@ -404,6 +405,9 @@ discard block |
||
| 404 | 405 | $this->transition_post_status_action( 'delete', $post->post_status, $post ); |
| 405 | 406 | } |
| 406 | 407 | |
| 408 | + /** |
|
| 409 | + * @param string $new_status |
|
| 410 | + */ |
|
| 407 | 411 | function transition_post_status_action( $new_status, $old_status, $post ) { |
| 408 | 412 | $sync = $this->get_post_sync_operation( $new_status, $old_status, $post, $this->sync_conditions['posts'] ); |
| 409 | 413 | if ( ! $sync ) { |
@@ -807,6 +811,11 @@ discard block |
||
| 807 | 811 | /* Options Sync */ |
| 808 | 812 | |
| 809 | 813 | /* Ah... so much simpler than Posts and Comments :) */ |
| 814 | + |
|
| 815 | + /** |
|
| 816 | + * @param string $file |
|
| 817 | + * @param string $option |
|
| 818 | + */ |
|
| 810 | 819 | function options( $file, $option /*, $option, ... */ ) { |
| 811 | 820 | $options = func_get_args(); |
| 812 | 821 | $file = array_shift( $options ); |
@@ -915,6 +924,7 @@ discard block |
||
| 915 | 924 | |
| 916 | 925 | /** |
| 917 | 926 | * Returns default values of Constants |
| 927 | + * @param string $constant |
|
| 918 | 928 | */ |
| 919 | 929 | function default_constant( $constant ) { |
| 920 | 930 | switch ( $constant ) { |
@@ -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'; |