@@ -26,7 +26,6 @@ discard block |
||
26 | 26 | * |
27 | 27 | * Used to construct meta links in API responses |
28 | 28 | * |
29 | - * @param mixed $args Optional arguments to be appended to URL |
|
30 | 29 | * @return string Endpoint URL |
31 | 30 | **/ |
32 | 31 | function get_link() { |
@@ -117,7 +116,7 @@ discard block |
||
117 | 116 | * This method is used in get_link() to construct meta links for API responses. |
118 | 117 | * |
119 | 118 | * @param $template_path The generic endpoint path, e.g. /sites/%s |
120 | - * @param $path string The current endpoint path, relative to the version, e.g. /sites/12345 |
|
119 | + * @param string $path string The current endpoint path, relative to the version, e.g. /sites/12345 |
|
121 | 120 | * @param $method string Request method used to access the endpoint path |
122 | 121 | * @return string The current version, or otherwise the maximum version available |
123 | 122 | */ |
@@ -1341,6 +1341,7 @@ discard block |
||
1341 | 1341 | * timezone set in the options table for the blog or the GMT offset. |
1342 | 1342 | * |
1343 | 1343 | * @param datetime string |
1344 | + * @param string $date_string |
|
1344 | 1345 | * |
1345 | 1346 | * @return array( $local_time_string, $gmt_time_string ) |
1346 | 1347 | */ |
@@ -1458,6 +1459,10 @@ discard block |
||
1458 | 1459 | do_action( 'restapi_theme_init' ); |
1459 | 1460 | } |
1460 | 1461 | |
1462 | + /** |
|
1463 | + * @param string $from_hook |
|
1464 | + * @param string $to_hook |
|
1465 | + */ |
|
1461 | 1466 | function copy_hooks( $from_hook, $to_hook, $base_paths ) { |
1462 | 1467 | global $wp_filter; |
1463 | 1468 | foreach ( $wp_filter as $hook => $actions ) { |
@@ -23,6 +23,9 @@ |
||
23 | 23 | public $blog_id; |
24 | 24 | public $platform; |
25 | 25 | |
26 | + /** |
|
27 | + * @param WPORG_Platform $platform |
|
28 | + */ |
|
26 | 29 | public function __construct( $blog_id, $platform ) { |
27 | 30 | $this->blog_id = $blog_id; |
28 | 31 | $this->platform = $platform; |
@@ -120,6 +120,9 @@ discard block |
||
120 | 120 | return $response; |
121 | 121 | } |
122 | 122 | |
123 | + /** |
|
124 | + * @param string $field |
|
125 | + */ |
|
123 | 126 | protected function get_sal_post_by( $field, $field_value, $context ) { |
124 | 127 | global $blog_id; |
125 | 128 | |
@@ -132,6 +135,9 @@ discard block |
||
132 | 135 | return $post; |
133 | 136 | } |
134 | 137 | |
138 | + /** |
|
139 | + * @param string $context |
|
140 | + */ |
|
135 | 141 | private function render_response_keys( $post, $context, $keys ) { |
136 | 142 | foreach ( $keys as $key ) { |
137 | 143 | switch ( $key ) { |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | } |
1114 | 1114 | /** |
1115 | 1115 | * Does the network allow admins to add new users. |
1116 | - * @return boolian |
|
1116 | + * @return boolean |
|
1117 | 1117 | */ |
1118 | 1118 | static function network_add_new_users( $option = null ) { |
1119 | 1119 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1161,7 +1161,7 @@ discard block |
||
1161 | 1161 | * database which could be set to anything as opposed to what this function returns. |
1162 | 1162 | * @param bool $option |
1163 | 1163 | * |
1164 | - * @return boolean |
|
1164 | + * @return string |
|
1165 | 1165 | */ |
1166 | 1166 | public function is_main_network_option( $option ) { |
1167 | 1167 | // return '1' or '' |
@@ -1172,7 +1172,7 @@ discard block |
||
1172 | 1172 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1173 | 1173 | * |
1174 | 1174 | * @param string $option |
1175 | - * @return boolean |
|
1175 | + * @return string |
|
1176 | 1176 | */ |
1177 | 1177 | public function is_multisite( $option ) { |
1178 | 1178 | return (string) (bool) is_multisite(); |
@@ -1270,7 +1270,7 @@ discard block |
||
1270 | 1270 | |
1271 | 1271 | /** |
1272 | 1272 | * Returns true if the site has file write access false otherwise. |
1273 | - * @return string ( '1' | '0' ) |
|
1273 | + * @return integer ( '1' | '0' ) |
|
1274 | 1274 | **/ |
1275 | 1275 | public static function file_system_write_access() { |
1276 | 1276 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2080,7 +2080,7 @@ discard block |
||
2080 | 2080 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
2081 | 2081 | * |
2082 | 2082 | * @param string $name Option name |
2083 | - * @param mixed $default (optional) |
|
2083 | + * @param boolean $default (optional) |
|
2084 | 2084 | */ |
2085 | 2085 | public static function get_option( $name, $default = false ) { |
2086 | 2086 | return Jetpack_Options::get_option( $name, $default ); |
@@ -2090,6 +2090,7 @@ discard block |
||
2090 | 2090 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
2091 | 2091 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
2092 | 2092 | * $name must be a registered option name. |
2093 | + * @param string $name |
|
2093 | 2094 | */ |
2094 | 2095 | public static function create_nonce( $name ) { |
2095 | 2096 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -2147,6 +2148,7 @@ discard block |
||
2147 | 2148 | * @param int $user_id |
2148 | 2149 | * @param string $token |
2149 | 2150 | * return bool |
2151 | + * @param boolean $is_master_user |
|
2150 | 2152 | */ |
2151 | 2153 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2152 | 2154 | // not designed for concurrent updates |
@@ -2541,6 +2543,7 @@ discard block |
||
2541 | 2543 | |
2542 | 2544 | /** |
2543 | 2545 | * Like core's get_file_data implementation, but caches the result. |
2546 | + * @param string $file |
|
2544 | 2547 | */ |
2545 | 2548 | public static function get_file_data( $file, $headers ) { |
2546 | 2549 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2569,7 +2572,7 @@ discard block |
||
2569 | 2572 | * |
2570 | 2573 | * @param string $tag Tag as it appears in each module heading. |
2571 | 2574 | * |
2572 | - * @return mixed |
|
2575 | + * @return string |
|
2573 | 2576 | */ |
2574 | 2577 | public static function translate_module_tag( $tag ) { |
2575 | 2578 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2887,6 +2890,9 @@ discard block |
||
2887 | 2890 | $this->sync->sync_all_module_options( $module ); |
2888 | 2891 | } |
2889 | 2892 | |
2893 | + /** |
|
2894 | + * @return string |
|
2895 | + */ |
|
2890 | 2896 | public static function deactivate_module( $module ) { |
2891 | 2897 | /** |
2892 | 2898 | * Fires when a module is deactivated. |
@@ -2925,6 +2931,9 @@ discard block |
||
2925 | 2931 | return Jetpack_Options::update_option( 'active_modules', array_unique( $new ) ); |
2926 | 2932 | } |
2927 | 2933 | |
2934 | + /** |
|
2935 | + * @param string $module |
|
2936 | + */ |
|
2928 | 2937 | public static function enable_module_configurable( $module ) { |
2929 | 2938 | $module = Jetpack::get_module_slug( $module ); |
2930 | 2939 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2935,21 +2944,33 @@ discard block |
||
2935 | 2944 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2936 | 2945 | } |
2937 | 2946 | |
2947 | + /** |
|
2948 | + * @param string $module |
|
2949 | + */ |
|
2938 | 2950 | public static function module_configuration_load( $module, $method ) { |
2939 | 2951 | $module = Jetpack::get_module_slug( $module ); |
2940 | 2952 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2941 | 2953 | } |
2942 | 2954 | |
2955 | + /** |
|
2956 | + * @param string $module |
|
2957 | + */ |
|
2943 | 2958 | public static function module_configuration_head( $module, $method ) { |
2944 | 2959 | $module = Jetpack::get_module_slug( $module ); |
2945 | 2960 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2946 | 2961 | } |
2947 | 2962 | |
2963 | + /** |
|
2964 | + * @param string $module |
|
2965 | + */ |
|
2948 | 2966 | public static function module_configuration_screen( $module, $method ) { |
2949 | 2967 | $module = Jetpack::get_module_slug( $module ); |
2950 | 2968 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2951 | 2969 | } |
2952 | 2970 | |
2971 | + /** |
|
2972 | + * @param string $module |
|
2973 | + */ |
|
2953 | 2974 | public static function module_configuration_activation_screen( $module, $method ) { |
2954 | 2975 | $module = Jetpack::get_module_slug( $module ); |
2955 | 2976 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2957,6 +2978,9 @@ discard block |
||
2957 | 2978 | |
2958 | 2979 | /* Installation */ |
2959 | 2980 | |
2981 | + /** |
|
2982 | + * @param string $message |
|
2983 | + */ |
|
2960 | 2984 | public static function bail_on_activation( $message, $deactivate = true ) { |
2961 | 2985 | ?> |
2962 | 2986 | <!doctype html> |
@@ -3570,7 +3594,7 @@ discard block |
||
3570 | 3594 | * Add help to the Jetpack page |
3571 | 3595 | * |
3572 | 3596 | * @since Jetpack (1.2.3) |
3573 | - * @return false if not the Jetpack page |
|
3597 | + * @return false|null if not the Jetpack page |
|
3574 | 3598 | */ |
3575 | 3599 | function admin_help() { |
3576 | 3600 | $current_screen = get_current_screen(); |
@@ -4886,6 +4910,7 @@ discard block |
||
4886 | 4910 | /** |
4887 | 4911 | * Returns the requested Jetpack API URL |
4888 | 4912 | * |
4913 | + * @param string $relative_url |
|
4889 | 4914 | * @return string |
4890 | 4915 | */ |
4891 | 4916 | public static function api_url( $relative_url ) { |
@@ -4988,7 +5013,8 @@ discard block |
||
4988 | 5013 | * Note these tokens are unique per call, NOT static per site for connecting. |
4989 | 5014 | * |
4990 | 5015 | * @since 2.6 |
4991 | - * @return array |
|
5016 | + * @param string $action |
|
5017 | + * @return string |
|
4992 | 5018 | */ |
4993 | 5019 | public function generate_secrets( $action ) { |
4994 | 5020 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -5309,6 +5335,10 @@ discard block |
||
5309 | 5335 | return new WP_User( $token_details['user_id'] ); |
5310 | 5336 | } |
5311 | 5337 | |
5338 | + /** |
|
5339 | + * @param integer $timestamp |
|
5340 | + * @param string $nonce |
|
5341 | + */ |
|
5312 | 5342 | function add_nonce( $timestamp, $nonce ) { |
5313 | 5343 | global $wpdb; |
5314 | 5344 | static $nonces_used_this_request = array(); |
@@ -5514,6 +5544,9 @@ discard block |
||
5514 | 5544 | Jetpack::state( null, null, true ); |
5515 | 5545 | } |
5516 | 5546 | |
5547 | + /** |
|
5548 | + * @param string $file |
|
5549 | + */ |
|
5517 | 5550 | public static function check_privacy( $file ) { |
5518 | 5551 | static $is_site_publicly_accessible = null; |
5519 | 5552 | |
@@ -5841,7 +5874,7 @@ discard block |
||
5841 | 5874 | /** |
5842 | 5875 | * Pings the WordPress.com Mirror Site for the specified options. |
5843 | 5876 | * |
5844 | - * @param string|array $option_names The option names to request from the WordPress.com Mirror Site |
|
5877 | + * @param string[] $option_names The option names to request from the WordPress.com Mirror Site |
|
5845 | 5878 | * |
5846 | 5879 | * @return array An associative array of the option values as stored in the WordPress.com Mirror Site |
5847 | 5880 | */ |
@@ -5865,7 +5898,7 @@ discard block |
||
5865 | 5898 | /** |
5866 | 5899 | * Fetch the filtered array of options that we should compare to determine an identity crisis. |
5867 | 5900 | * |
5868 | - * @return array An array of options to check. |
|
5901 | + * @return string[] An array of options to check. |
|
5869 | 5902 | */ |
5870 | 5903 | public static function identity_crisis_options_to_check() { |
5871 | 5904 | return array( |
@@ -6536,8 +6569,8 @@ discard block |
||
6536 | 6569 | * - Absolute URLs `http://domain.com/feh.png` |
6537 | 6570 | * - Domain root relative URLs `/feh.png` |
6538 | 6571 | * |
6539 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6540 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6572 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6573 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6541 | 6574 | * |
6542 | 6575 | * @return mixed|string |
6543 | 6576 | */ |
@@ -6933,7 +6966,6 @@ discard block |
||
6933 | 6966 | } |
6934 | 6967 | |
6935 | 6968 | /** |
6936 | - * @param mixed $result Value for the user's option |
|
6937 | 6969 | * @return mixed |
6938 | 6970 | */ |
6939 | 6971 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -181,7 +181,7 @@ |
||
181 | 181 | /** |
182 | 182 | * Backend function to abstract the xmlrpc function calls to wpcom. |
183 | 183 | * |
184 | - * @param $endpoint |
|
184 | + * @param string $endpoint |
|
185 | 185 | * @param $error_message |
186 | 186 | */ |
187 | 187 | function __process_ajax_proxy_request( $endpoint, $error_message ) { |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * Validate the require two step checkbox in Settings > General |
263 | 263 | * |
264 | 264 | * @since 2.7 |
265 | - * @return boolean |
|
265 | + * @return integer |
|
266 | 266 | **/ |
267 | 267 | public function validate_jetpack_sso_require_two_step( $input ) { |
268 | 268 | return ( ! empty( $input ) ) ? 1 : 0; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * Validate the match by email check in Settings > General |
288 | 288 | * |
289 | 289 | * @since 2.9 |
290 | - * @return boolean |
|
290 | + * @return integer |
|
291 | 291 | **/ |
292 | 292 | public function validate_jetpack_sso_match_by_email( $input ) { |
293 | 293 | return ( ! empty( $input ) ) ? 1 : 0; |
@@ -253,6 +253,8 @@ |
||
253 | 253 | * And we'll magically convert it to a list. This has the added benefit |
254 | 254 | * of including itemprops for the recipe schema. |
255 | 255 | * |
256 | + * @param string $content |
|
257 | + * @param string $type |
|
256 | 258 | * @return string content formatted as a list item |
257 | 259 | */ |
258 | 260 | static function output_list_content( $content, $type ) { |
@@ -102,9 +102,9 @@ |
||
102 | 102 | * Parameters are the same as preg_replace, with an added optional search param for improved performance |
103 | 103 | * |
104 | 104 | * @param String $pattern |
105 | - * @param String $replacement |
|
106 | 105 | * @param String $content |
107 | 106 | * @param String $search |
107 | + * @param string $callback |
|
108 | 108 | * @return String $content |
109 | 109 | */ |
110 | 110 | function jetpack_preg_replace_callback_outside_tags( $pattern, $callback, $content, $search = null ) { |