@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | } |
1100 | 1100 | /** |
1101 | 1101 | * Does the network allow admins to add new users. |
1102 | - * @return boolian |
|
1102 | + * @return boolean |
|
1103 | 1103 | */ |
1104 | 1104 | static function network_add_new_users( $option = null ) { |
1105 | 1105 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | * database which could be set to anything as opposed to what this function returns. |
1148 | 1148 | * @param bool $option |
1149 | 1149 | * |
1150 | - * @return boolean |
|
1150 | + * @return string |
|
1151 | 1151 | */ |
1152 | 1152 | public function is_main_network_option( $option ) { |
1153 | 1153 | // return '1' or '' |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1159 | 1159 | * |
1160 | 1160 | * @param string $option |
1161 | - * @return boolean |
|
1161 | + * @return string |
|
1162 | 1162 | */ |
1163 | 1163 | public function is_multisite( $option ) { |
1164 | 1164 | return (string) (bool) is_multisite(); |
@@ -1256,7 +1256,7 @@ discard block |
||
1256 | 1256 | |
1257 | 1257 | /** |
1258 | 1258 | * Returns true if the site has file write access false otherwise. |
1259 | - * @return string ( '1' | '0' ) |
|
1259 | + * @return integer ( '1' | '0' ) |
|
1260 | 1260 | **/ |
1261 | 1261 | public static function file_system_write_access() { |
1262 | 1262 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2053,7 +2053,7 @@ discard block |
||
2053 | 2053 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
2054 | 2054 | * |
2055 | 2055 | * @param string $name Option name |
2056 | - * @param mixed $default (optional) |
|
2056 | + * @param boolean $default (optional) |
|
2057 | 2057 | */ |
2058 | 2058 | public static function get_option( $name, $default = false ) { |
2059 | 2059 | return Jetpack_Options::get_option( $name, $default ); |
@@ -2063,6 +2063,7 @@ discard block |
||
2063 | 2063 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
2064 | 2064 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
2065 | 2065 | * $name must be a registered option name. |
2066 | + * @param string $name |
|
2066 | 2067 | */ |
2067 | 2068 | public static function create_nonce( $name ) { |
2068 | 2069 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -2120,6 +2121,7 @@ discard block |
||
2120 | 2121 | * @param int $user_id |
2121 | 2122 | * @param string $token |
2122 | 2123 | * return bool |
2124 | + * @param boolean $is_master_user |
|
2123 | 2125 | */ |
2124 | 2126 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2125 | 2127 | // not designed for concurrent updates |
@@ -2514,6 +2516,7 @@ discard block |
||
2514 | 2516 | |
2515 | 2517 | /** |
2516 | 2518 | * Like core's get_file_data implementation, but caches the result. |
2519 | + * @param string $file |
|
2517 | 2520 | */ |
2518 | 2521 | public static function get_file_data( $file, $headers ) { |
2519 | 2522 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2542,7 +2545,7 @@ discard block |
||
2542 | 2545 | * |
2543 | 2546 | * @param string $tag Tag as it appears in each module heading. |
2544 | 2547 | * |
2545 | - * @return mixed |
|
2548 | + * @return string |
|
2546 | 2549 | */ |
2547 | 2550 | public static function translate_module_tag( $tag ) { |
2548 | 2551 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2857,6 +2860,9 @@ discard block |
||
2857 | 2860 | $this->sync->sync_all_module_options( $module ); |
2858 | 2861 | } |
2859 | 2862 | |
2863 | + /** |
|
2864 | + * @return string |
|
2865 | + */ |
|
2860 | 2866 | public static function deactivate_module( $module ) { |
2861 | 2867 | /** |
2862 | 2868 | * Fires when a module is deactivated. |
@@ -2895,6 +2901,9 @@ discard block |
||
2895 | 2901 | return Jetpack_Options::update_option( 'active_modules', array_unique( $new ) ); |
2896 | 2902 | } |
2897 | 2903 | |
2904 | + /** |
|
2905 | + * @param string $module |
|
2906 | + */ |
|
2898 | 2907 | public static function enable_module_configurable( $module ) { |
2899 | 2908 | $module = Jetpack::get_module_slug( $module ); |
2900 | 2909 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2905,21 +2914,33 @@ discard block |
||
2905 | 2914 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2906 | 2915 | } |
2907 | 2916 | |
2917 | + /** |
|
2918 | + * @param string $module |
|
2919 | + */ |
|
2908 | 2920 | public static function module_configuration_load( $module, $method ) { |
2909 | 2921 | $module = Jetpack::get_module_slug( $module ); |
2910 | 2922 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2911 | 2923 | } |
2912 | 2924 | |
2925 | + /** |
|
2926 | + * @param string $module |
|
2927 | + */ |
|
2913 | 2928 | public static function module_configuration_head( $module, $method ) { |
2914 | 2929 | $module = Jetpack::get_module_slug( $module ); |
2915 | 2930 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2916 | 2931 | } |
2917 | 2932 | |
2933 | + /** |
|
2934 | + * @param string $module |
|
2935 | + */ |
|
2918 | 2936 | public static function module_configuration_screen( $module, $method ) { |
2919 | 2937 | $module = Jetpack::get_module_slug( $module ); |
2920 | 2938 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2921 | 2939 | } |
2922 | 2940 | |
2941 | + /** |
|
2942 | + * @param string $module |
|
2943 | + */ |
|
2923 | 2944 | public static function module_configuration_activation_screen( $module, $method ) { |
2924 | 2945 | $module = Jetpack::get_module_slug( $module ); |
2925 | 2946 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2927,6 +2948,9 @@ discard block |
||
2927 | 2948 | |
2928 | 2949 | /* Installation */ |
2929 | 2950 | |
2951 | + /** |
|
2952 | + * @param string $message |
|
2953 | + */ |
|
2930 | 2954 | public static function bail_on_activation( $message, $deactivate = true ) { |
2931 | 2955 | ?> |
2932 | 2956 | <!doctype html> |
@@ -3540,7 +3564,7 @@ discard block |
||
3540 | 3564 | * Add help to the Jetpack page |
3541 | 3565 | * |
3542 | 3566 | * @since Jetpack (1.2.3) |
3543 | - * @return false if not the Jetpack page |
|
3567 | + * @return false|null if not the Jetpack page |
|
3544 | 3568 | */ |
3545 | 3569 | function admin_help() { |
3546 | 3570 | $current_screen = get_current_screen(); |
@@ -4830,6 +4854,7 @@ discard block |
||
4830 | 4854 | /** |
4831 | 4855 | * Returns the requested Jetpack API URL |
4832 | 4856 | * |
4857 | + * @param string $relative_url |
|
4833 | 4858 | * @return string |
4834 | 4859 | */ |
4835 | 4860 | public static function api_url( $relative_url ) { |
@@ -5254,6 +5279,10 @@ discard block |
||
5254 | 5279 | return new WP_User( $token_details['user_id'] ); |
5255 | 5280 | } |
5256 | 5281 | |
5282 | + /** |
|
5283 | + * @param integer $timestamp |
|
5284 | + * @param string $nonce |
|
5285 | + */ |
|
5257 | 5286 | function add_nonce( $timestamp, $nonce ) { |
5258 | 5287 | global $wpdb; |
5259 | 5288 | static $nonces_used_this_request = array(); |
@@ -5459,6 +5488,9 @@ discard block |
||
5459 | 5488 | Jetpack::state( null, null, true ); |
5460 | 5489 | } |
5461 | 5490 | |
5491 | + /** |
|
5492 | + * @param string $file |
|
5493 | + */ |
|
5462 | 5494 | public static function check_privacy( $file ) { |
5463 | 5495 | static $is_site_publicly_accessible = null; |
5464 | 5496 | |
@@ -6488,8 +6520,8 @@ discard block |
||
6488 | 6520 | * - Absolute URLs `http://domain.com/feh.png` |
6489 | 6521 | * - Domain root relative URLs `/feh.png` |
6490 | 6522 | * |
6491 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6492 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6523 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6524 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6493 | 6525 | * |
6494 | 6526 | * @return mixed|string |
6495 | 6527 | */ |
@@ -6885,7 +6917,6 @@ discard block |
||
6885 | 6917 | } |
6886 | 6918 | |
6887 | 6919 | /** |
6888 | - * @param mixed $result Value for the user's option |
|
6889 | 6920 | * @return mixed |
6890 | 6921 | */ |
6891 | 6922 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -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'; |
@@ -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 ) { |
@@ -29,6 +29,7 @@ discard block |
||
29 | 29 | public $did_output = false; |
30 | 30 | |
31 | 31 | /** |
32 | + * @param string $method |
|
32 | 33 | * @return WPCOM_JSON_API instance |
33 | 34 | */ |
34 | 35 | static function init( $method = null, $url = null, $post_body = null, $return_new = false ) { |
@@ -333,6 +334,9 @@ discard block |
||
333 | 334 | return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); |
334 | 335 | } |
335 | 336 | |
337 | + /** |
|
338 | + * @param integer $status_code |
|
339 | + */ |
|
336 | 340 | function output_early( $status_code, $response = null, $content_type = 'application/json' ) { |
337 | 341 | $exit = $this->exit; |
338 | 342 | $this->exit = false; |
@@ -527,6 +531,9 @@ discard block |
||
527 | 531 | return json_encode( $data ); |
528 | 532 | } |
529 | 533 | |
534 | + /** |
|
535 | + * @param string $needle |
|
536 | + */ |
|
530 | 537 | function ends_with( $haystack, $needle ) { |
531 | 538 | return $needle === substr( $haystack, -strlen( $needle ) ); |
532 | 539 | } |
@@ -554,6 +561,10 @@ discard block |
||
554 | 561 | } |
555 | 562 | |
556 | 563 | // Returns true if the specified blog ID is a restricted blog |
564 | + |
|
565 | + /** |
|
566 | + * @param integer $blog_id |
|
567 | + */ |
|
557 | 568 | function is_restricted_blog( $blog_id ) { |
558 | 569 | /** |
559 | 570 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |
@@ -617,6 +628,7 @@ discard block |
||
617 | 628 | * The result is always output, never returned. |
618 | 629 | * |
619 | 630 | * @param string|null $error_code. Call with string to start the trapping. Call with null to stop. |
631 | + * @param string $error_code |
|
620 | 632 | */ |
621 | 633 | function trap_wp_die( $error_code = null ) { |
622 | 634 | // Stop trapping |
@@ -616,6 +616,9 @@ |
||
616 | 616 | return strcasecmp( $a->name, $b->name ); |
617 | 617 | } |
618 | 618 | |
619 | + /** |
|
620 | + * @return string |
|
621 | + */ |
|
619 | 622 | public static function maybe_get_split_term( $old_term_id = '', $taxonomy = '' ) { |
620 | 623 | $term_id = $old_term_id; |
621 | 624 |