@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * |
137 | 137 | * @param string $item The item to be added. |
138 | 138 | * |
139 | - * @return bool True if the append succeeded, False if not. |
|
139 | + * @return boolean|null True if the append succeeded, False if not. |
|
140 | 140 | */ |
141 | 141 | public function try_to_add_item( $item ) { |
142 | 142 | _deprecated_function( |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * |
156 | 156 | * @since 5.3.0 |
157 | 157 | * |
158 | - * @param array $array The item to be added. |
|
158 | + * @param string $array The item to be added. |
|
159 | 159 | * |
160 | 160 | * @return bool True if the append succeeded, False if not. |
161 | 161 | */ |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @param DOMElement $parent (optional) an element to which new children should be added. |
281 | 281 | * @param DOMDocument $root (optional) the parent document. |
282 | 282 | * |
283 | - * @return string|DOMDocument The rendered XML string or an object if root element is specified. |
|
283 | + * @return null|DOMNode The rendered XML string or an object if root element is specified. |
|
284 | 284 | */ |
285 | 285 | protected function array_to_xml_string( $array, $parent = null, $root = null ) { |
286 | 286 | $return_string = false; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * @param string $url_orig Original URL. |
9 | 9 | * @param array $url_info Pieces of original URL. |
10 | 10 | * |
11 | - * @return bool |
|
11 | + * @return false|string |
|
12 | 12 | */ |
13 | 13 | function jetpack_no_qtranslate_rest_url_redirect( $url_lang, $url_orig, $url_info ) { |
14 | 14 | if ( false !== strpos( $url_info['wp-path'], 'wp-json/jetpack' ) ) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * Convenience function for grabbing options from params->options |
48 | 48 | * @param string $option the option to grab |
49 | - * @param mixed $default (optional) |
|
49 | + * @param boolean $default (optional) |
|
50 | 50 | * @return option or $default if not set |
51 | 51 | * |
52 | 52 | * @since 4.5.0 |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | /** |
397 | 397 | * Check the reasons to bail before we attempt to insert ads. |
398 | - * @return true if we should bail (don't insert ads) |
|
398 | + * @return boolean if we should bail (don't insert ads) |
|
399 | 399 | * |
400 | 400 | * @since 4.5.0 |
401 | 401 | */ |
@@ -598,7 +598,6 @@ discard block |
||
598 | 598 | * @uses Jetpack::disconnect(); |
599 | 599 | * @since 4.3.0 |
600 | 600 | * |
601 | - * @param WP_REST_Request $request The request sent to the WP REST API. |
|
602 | 601 | * |
603 | 602 | * @return string|WP_Error A raw URL if the connection URL could be built; error message otherwise. |
604 | 603 | */ |
@@ -618,7 +617,6 @@ discard block |
||
618 | 617 | * |
619 | 618 | * @since 4.3.0 |
620 | 619 | * |
621 | - * @param WP_REST_Request $request The request sent to the WP REST API. |
|
622 | 620 | * |
623 | 621 | * @return object |
624 | 622 | */ |
@@ -63,6 +63,7 @@ |
||
63 | 63 | /** |
64 | 64 | * Updates user data |
65 | 65 | * |
66 | + * @param integer $user_id |
|
66 | 67 | * @return array |
67 | 68 | */ |
68 | 69 | public function update_user( $user_id, $blog_id ) { |
@@ -242,6 +242,7 @@ |
||
242 | 242 | /** |
243 | 243 | * Returns the current error as an IXR_Error |
244 | 244 | * |
245 | + * @param string $tracks_event_name |
|
245 | 246 | * @return bool|IXR_Error |
246 | 247 | */ |
247 | 248 | function error( $error = null, $tracks_event_name = null, $user = null ) { |
@@ -125,6 +125,9 @@ discard block |
||
125 | 125 | wp_enqueue_script( 'a8c_wpcom_masterbar_overrides', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/masterbar-overrides/masterbar.js' ), array( 'jquery' ), JETPACK__VERSION ); |
126 | 126 | } |
127 | 127 | |
128 | + /** |
|
129 | + * @param string $file |
|
130 | + */ |
|
128 | 131 | function wpcom_static_url( $file ) { |
129 | 132 | if ( ! empty( $this->sandbox_url ) ) { |
130 | 133 | // For testing undeployed changes to remotely enqueued scripts and styles. |
@@ -307,6 +310,9 @@ discard block |
||
307 | 310 | return $primary_anchor . $secondary_anchor; |
308 | 311 | } |
309 | 312 | |
313 | + /** |
|
314 | + * @param string $class |
|
315 | + */ |
|
310 | 316 | public function create_menu_item_anchor( $class, $url, $label, $id ) { |
311 | 317 | return '<a href="' . $url . '" class="' . $class . '" id="' . $id . '">' . $label . '</a>'; |
312 | 318 | } |
@@ -1024,7 +1024,7 @@ discard block |
||
1024 | 1024 | } |
1025 | 1025 | /** |
1026 | 1026 | * Does the network allow admins to add new users. |
1027 | - * @return boolian |
|
1027 | + * @return boolean |
|
1028 | 1028 | */ |
1029 | 1029 | static function network_add_new_users( $option = null ) { |
1030 | 1030 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | * database which could be set to anything as opposed to what this function returns. |
1130 | 1130 | * @param bool $option |
1131 | 1131 | * |
1132 | - * @return boolean |
|
1132 | + * @return string |
|
1133 | 1133 | */ |
1134 | 1134 | public function is_main_network_option( $option ) { |
1135 | 1135 | // return '1' or '' |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1141 | 1141 | * |
1142 | 1142 | * @param string $option |
1143 | - * @return boolean |
|
1143 | + * @return string |
|
1144 | 1144 | */ |
1145 | 1145 | public function is_multisite( $option ) { |
1146 | 1146 | return (string) (bool) is_multisite(); |
@@ -1202,7 +1202,7 @@ discard block |
||
1202 | 1202 | |
1203 | 1203 | /** |
1204 | 1204 | * Returns true if the site has file write access false otherwise. |
1205 | - * @return string ( '1' | '0' ) |
|
1205 | + * @return integer ( '1' | '0' ) |
|
1206 | 1206 | **/ |
1207 | 1207 | public static function file_system_write_access() { |
1208 | 1208 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1441,6 +1441,7 @@ discard block |
||
1441 | 1441 | * @access public |
1442 | 1442 | * @static |
1443 | 1443 | * |
1444 | + * @param string $feature |
|
1444 | 1445 | * @return bool True if plan supports feature, false if not |
1445 | 1446 | */ |
1446 | 1447 | public static function active_plan_supports( $feature ) { |
@@ -1977,6 +1978,7 @@ discard block |
||
1977 | 1978 | * @param int $user_id |
1978 | 1979 | * @param string $token |
1979 | 1980 | * return bool |
1981 | + * @param boolean $is_master_user |
|
1980 | 1982 | */ |
1981 | 1983 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
1982 | 1984 | // not designed for concurrent updates |
@@ -2371,6 +2373,7 @@ discard block |
||
2371 | 2373 | |
2372 | 2374 | /** |
2373 | 2375 | * Like core's get_file_data implementation, but caches the result. |
2376 | + * @param string $file |
|
2374 | 2377 | */ |
2375 | 2378 | public static function get_file_data( $file, $headers ) { |
2376 | 2379 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2416,7 +2419,7 @@ discard block |
||
2416 | 2419 | * |
2417 | 2420 | * @param string $tag Tag as it appears in each module heading. |
2418 | 2421 | * |
2419 | - * @return mixed |
|
2422 | + * @return string |
|
2420 | 2423 | */ |
2421 | 2424 | public static function translate_module_tag( $tag ) { |
2422 | 2425 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2519,8 +2522,8 @@ discard block |
||
2519 | 2522 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2520 | 2523 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2521 | 2524 | * |
2522 | - * @param $string |
|
2523 | - * @return mixed |
|
2525 | + * @param string $string |
|
2526 | + * @return string|null |
|
2524 | 2527 | */ |
2525 | 2528 | public static function alias_directories( $string ) { |
2526 | 2529 | // ABSPATH has a trailing slash. |
@@ -2794,6 +2797,9 @@ discard block |
||
2794 | 2797 | return self::update_active_modules( $new ); |
2795 | 2798 | } |
2796 | 2799 | |
2800 | + /** |
|
2801 | + * @param string $module |
|
2802 | + */ |
|
2797 | 2803 | public static function enable_module_configurable( $module ) { |
2798 | 2804 | $module = Jetpack::get_module_slug( $module ); |
2799 | 2805 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2804,21 +2810,33 @@ discard block |
||
2804 | 2810 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2805 | 2811 | } |
2806 | 2812 | |
2813 | + /** |
|
2814 | + * @param string $module |
|
2815 | + */ |
|
2807 | 2816 | public static function module_configuration_load( $module, $method ) { |
2808 | 2817 | $module = Jetpack::get_module_slug( $module ); |
2809 | 2818 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2810 | 2819 | } |
2811 | 2820 | |
2821 | + /** |
|
2822 | + * @param string $module |
|
2823 | + */ |
|
2812 | 2824 | public static function module_configuration_head( $module, $method ) { |
2813 | 2825 | $module = Jetpack::get_module_slug( $module ); |
2814 | 2826 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2815 | 2827 | } |
2816 | 2828 | |
2829 | + /** |
|
2830 | + * @param string $module |
|
2831 | + */ |
|
2817 | 2832 | public static function module_configuration_screen( $module, $method ) { |
2818 | 2833 | $module = Jetpack::get_module_slug( $module ); |
2819 | 2834 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2820 | 2835 | } |
2821 | 2836 | |
2837 | + /** |
|
2838 | + * @param string $module |
|
2839 | + */ |
|
2822 | 2840 | public static function module_configuration_activation_screen( $module, $method ) { |
2823 | 2841 | $module = Jetpack::get_module_slug( $module ); |
2824 | 2842 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2826,6 +2844,9 @@ discard block |
||
2826 | 2844 | |
2827 | 2845 | /* Installation */ |
2828 | 2846 | |
2847 | + /** |
|
2848 | + * @param string $message |
|
2849 | + */ |
|
2829 | 2850 | public static function bail_on_activation( $message, $deactivate = true ) { |
2830 | 2851 | ?> |
2831 | 2852 | <!doctype html> |
@@ -3526,7 +3547,7 @@ discard block |
||
3526 | 3547 | * Add help to the Jetpack page |
3527 | 3548 | * |
3528 | 3549 | * @since Jetpack (1.2.3) |
3529 | - * @return false if not the Jetpack page |
|
3550 | + * @return false|null if not the Jetpack page |
|
3530 | 3551 | */ |
3531 | 3552 | function admin_help() { |
3532 | 3553 | $current_screen = get_current_screen(); |
@@ -4577,6 +4598,7 @@ discard block |
||
4577 | 4598 | /** |
4578 | 4599 | * Returns the requested Jetpack API URL |
4579 | 4600 | * |
4601 | + * @param string $relative_url |
|
4580 | 4602 | * @return string |
4581 | 4603 | */ |
4582 | 4604 | public static function api_url( $relative_url ) { |
@@ -4735,7 +4757,8 @@ discard block |
||
4735 | 4757 | * Note these tokens are unique per call, NOT static per site for connecting. |
4736 | 4758 | * |
4737 | 4759 | * @since 2.6 |
4738 | - * @return array |
|
4760 | + * @param string $action |
|
4761 | + * @return boolean |
|
4739 | 4762 | */ |
4740 | 4763 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
4741 | 4764 | if ( ! $user_id ) { |
@@ -5220,7 +5243,6 @@ discard block |
||
5220 | 5243 | /** |
5221 | 5244 | * Report authentication status to the WP REST API. |
5222 | 5245 | * |
5223 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5224 | 5246 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5225 | 5247 | */ |
5226 | 5248 | public function wp_rest_authentication_errors( $value ) { |
@@ -5230,6 +5252,10 @@ discard block |
||
5230 | 5252 | return $this->rest_authentication_status; |
5231 | 5253 | } |
5232 | 5254 | |
5255 | + /** |
|
5256 | + * @param integer $timestamp |
|
5257 | + * @param string $nonce |
|
5258 | + */ |
|
5233 | 5259 | function add_nonce( $timestamp, $nonce ) { |
5234 | 5260 | global $wpdb; |
5235 | 5261 | static $nonces_used_this_request = array(); |
@@ -5375,6 +5401,7 @@ discard block |
||
5375 | 5401 | * @param string $key |
5376 | 5402 | * @param string $value |
5377 | 5403 | * @param bool $restate private |
5404 | + * @return string |
|
5378 | 5405 | */ |
5379 | 5406 | public static function state( $key = null, $value = null, $restate = false ) { |
5380 | 5407 | static $state = array(); |
@@ -5431,6 +5458,9 @@ discard block |
||
5431 | 5458 | Jetpack::state( null, null, true ); |
5432 | 5459 | } |
5433 | 5460 | |
5461 | + /** |
|
5462 | + * @param string $file |
|
5463 | + */ |
|
5434 | 5464 | public static function check_privacy( $file ) { |
5435 | 5465 | static $is_site_publicly_accessible = null; |
5436 | 5466 | |
@@ -6027,9 +6057,7 @@ discard block |
||
6027 | 6057 | * |
6028 | 6058 | * Attached to `style_loader_src` filter. |
6029 | 6059 | * |
6030 | - * @param string $tag The tag that would link to the external asset. |
|
6031 | 6060 | * @param string $handle The registered handle of the script in question. |
6032 | - * @param string $href The url of the asset in question. |
|
6033 | 6061 | */ |
6034 | 6062 | public static function set_suffix_on_min( $src, $handle ) { |
6035 | 6063 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6198,8 +6226,8 @@ discard block |
||
6198 | 6226 | * - Absolute URLs `http://domain.com/feh.png` |
6199 | 6227 | * - Domain root relative URLs `/feh.png` |
6200 | 6228 | * |
6201 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6202 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6229 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6230 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6203 | 6231 | * |
6204 | 6232 | * @return mixed|string |
6205 | 6233 | */ |
@@ -6490,7 +6518,7 @@ discard block |
||
6490 | 6518 | * |
6491 | 6519 | * @param string $option_name |
6492 | 6520 | * |
6493 | - * @return bool |
|
6521 | + * @return false|null |
|
6494 | 6522 | */ |
6495 | 6523 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6496 | 6524 | // Bail if Jump Start has already been dismissed |
@@ -6578,7 +6606,6 @@ discard block |
||
6578 | 6606 | } |
6579 | 6607 | |
6580 | 6608 | /** |
6581 | - * @param mixed $result Value for the user's option |
|
6582 | 6609 | * @return mixed |
6583 | 6610 | */ |
6584 | 6611 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -115,6 +115,11 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | // /sites/%s/taxonomies/%s/terms/new -> $blog_id, $taxonomy |
118 | + |
|
119 | + /** |
|
120 | + * @param string $path |
|
121 | + * @param string $taxonomy |
|
122 | + */ |
|
118 | 123 | function new_term( $path, $blog_id, $taxonomy ) { |
119 | 124 | $args = $this->query_args(); |
120 | 125 | $input = $this->input(); |
@@ -160,6 +165,12 @@ discard block |
||
160 | 165 | } |
161 | 166 | |
162 | 167 | // /sites/%s/taxonomies/%s/terms/slug:%s -> $blog_id, $taxonomy, $slug |
168 | + |
|
169 | + /** |
|
170 | + * @param string $path |
|
171 | + * @param string $slug |
|
172 | + * @param string $taxonomy |
|
173 | + */ |
|
163 | 174 | function update_term( $path, $blog_id, $slug, $taxonomy ) { |
164 | 175 | $tax = get_taxonomy( $taxonomy ); |
165 | 176 | if ( ! current_user_can( $tax->cap->edit_terms ) ) { |
@@ -208,6 +219,12 @@ discard block |
||
208 | 219 | } |
209 | 220 | |
210 | 221 | // /sites/%s/taxonomies/%s/terms/slug:%s/delete -> $blog_id, $taxonomy, $slug |
222 | + |
|
223 | + /** |
|
224 | + * @param string $path |
|
225 | + * @param string $slug |
|
226 | + * @param string $taxonomy |
|
227 | + */ |
|
211 | 228 | function delete_term( $path, $blog_id, $slug, $taxonomy ) { |
212 | 229 | $term = get_term_by( 'slug', $slug, $taxonomy ); |
213 | 230 | $tax = get_taxonomy( $taxonomy ); |