@@ -424,7 +424,7 @@ |
||
424 | 424 | * Only enqueue block assets when needed. |
425 | 425 | * |
426 | 426 | * @param string $type Slug of the block. |
427 | - * @param array $script_dependencies An array of view-side Javascript dependencies to be enqueued. |
|
427 | + * @param string[] $script_dependencies An array of view-side Javascript dependencies to be enqueued. |
|
428 | 428 | * |
429 | 429 | * @return void |
430 | 430 | */ |
@@ -410,7 +410,7 @@ |
||
410 | 410 | * |
411 | 411 | * @param Mixed $needle the needle. |
412 | 412 | * @param Array $haystack the haystack. |
413 | - * @return is the needle not in the haystack? |
|
413 | + * @return boolean the needle not in the haystack? |
|
414 | 414 | */ |
415 | 415 | protected function negative_in_array( $needle, $haystack ) { |
416 | 416 | if ( in_array( $needle, $haystack, true ) ) { |
@@ -42,6 +42,9 @@ discard block |
||
42 | 42 | return array(); |
43 | 43 | } |
44 | 44 | |
45 | + /** |
|
46 | + * @param string[] $actions_to_count |
|
47 | + */ |
|
45 | 48 | protected function count_actions( $action_names, $actions_to_count ) { |
46 | 49 | return count( array_intersect( $action_names, $actions_to_count ) ); |
47 | 50 | } |
@@ -58,6 +61,10 @@ discard block |
||
58 | 61 | return false; |
59 | 62 | } |
60 | 63 | |
64 | + /** |
|
65 | + * @param string $action_name |
|
66 | + * @param string $id_field |
|
67 | + */ |
|
61 | 68 | protected function enqueue_all_ids_as_action( $action_name, $table_name, $id_field, $where_sql, $max_items_to_enqueue, $state ) { |
62 | 69 | global $wpdb; |
63 | 70 | |
@@ -111,6 +118,9 @@ discard block |
||
111 | 118 | return $chunks_with_ends; |
112 | 119 | } |
113 | 120 | |
121 | + /** |
|
122 | + * @param string $meta_type |
|
123 | + */ |
|
114 | 124 | protected function get_metadata( $ids, $meta_type, $meta_key_whitelist ) { |
115 | 125 | global $wpdb; |
116 | 126 | $table = _get_meta_table( $meta_type ); |
@@ -131,12 +141,18 @@ discard block |
||
131 | 141 | ); |
132 | 142 | } |
133 | 143 | |
144 | + /** |
|
145 | + * @param string $meta_type |
|
146 | + */ |
|
134 | 147 | public function init_listeners_for_meta_type( $meta_type, $callable ) { |
135 | 148 | add_action( "added_{$meta_type}_meta", $callable, 10, 4 ); |
136 | 149 | add_action( "updated_{$meta_type}_meta", $callable, 10, 4 ); |
137 | 150 | add_action( "deleted_{$meta_type}_meta", $callable, 10, 4 ); |
138 | 151 | } |
139 | 152 | |
153 | + /** |
|
154 | + * @param string $meta_type |
|
155 | + */ |
|
140 | 156 | public function init_meta_whitelist_handler( $meta_type, $whitelist_handler ) { |
141 | 157 | add_filter( "jetpack_sync_before_enqueue_added_{$meta_type}_meta", $whitelist_handler ); |
142 | 158 | add_filter( "jetpack_sync_before_enqueue_updated_{$meta_type}_meta", $whitelist_handler ); |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | } |
1223 | 1223 | /** |
1224 | 1224 | * Does the network allow admins to add new users. |
1225 | - * @return boolian |
|
1225 | + * @return boolean |
|
1226 | 1226 | */ |
1227 | 1227 | static function network_add_new_users( $option = null ) { |
1228 | 1228 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1327,7 +1327,7 @@ discard block |
||
1327 | 1327 | * database which could be set to anything as opposed to what this function returns. |
1328 | 1328 | * @param bool $option |
1329 | 1329 | * |
1330 | - * @return boolean |
|
1330 | + * @return string |
|
1331 | 1331 | */ |
1332 | 1332 | public function is_main_network_option( $option ) { |
1333 | 1333 | // return '1' or '' |
@@ -1338,7 +1338,7 @@ discard block |
||
1338 | 1338 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1339 | 1339 | * |
1340 | 1340 | * @param string $option |
1341 | - * @return boolean |
|
1341 | + * @return string |
|
1342 | 1342 | */ |
1343 | 1343 | public function is_multisite( $option ) { |
1344 | 1344 | return (string) (bool) is_multisite(); |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | |
1401 | 1401 | /** |
1402 | 1402 | * Returns true if the site has file write access false otherwise. |
1403 | - * @return string ( '1' | '0' ) |
|
1403 | + * @return integer ( '1' | '0' ) |
|
1404 | 1404 | **/ |
1405 | 1405 | public static function file_system_write_access() { |
1406 | 1406 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2131,6 +2131,7 @@ discard block |
||
2131 | 2131 | * @param int $user_id |
2132 | 2132 | * @param string $token |
2133 | 2133 | * return bool |
2134 | + * @param boolean $is_master_user |
|
2134 | 2135 | */ |
2135 | 2136 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2136 | 2137 | // not designed for concurrent updates |
@@ -2569,7 +2570,7 @@ discard block |
||
2569 | 2570 | * |
2570 | 2571 | * @param string $tag Tag as it appears in each module heading. |
2571 | 2572 | * |
2572 | - * @return mixed |
|
2573 | + * @return string |
|
2573 | 2574 | */ |
2574 | 2575 | public static function translate_module_tag( $tag ) { |
2575 | 2576 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2741,8 +2742,8 @@ discard block |
||
2741 | 2742 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2742 | 2743 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2743 | 2744 | * |
2744 | - * @param $string |
|
2745 | - * @return mixed |
|
2745 | + * @param string $string |
|
2746 | + * @return string|null |
|
2746 | 2747 | */ |
2747 | 2748 | public static function alias_directories( $string ) { |
2748 | 2749 | // ABSPATH has a trailing slash. |
@@ -3022,6 +3023,9 @@ discard block |
||
3022 | 3023 | return self::update_active_modules( $new ); |
3023 | 3024 | } |
3024 | 3025 | |
3026 | + /** |
|
3027 | + * @param string $module |
|
3028 | + */ |
|
3025 | 3029 | public static function enable_module_configurable( $module ) { |
3026 | 3030 | $module = Jetpack::get_module_slug( $module ); |
3027 | 3031 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3049,21 +3053,33 @@ discard block |
||
3049 | 3053 | return $url; |
3050 | 3054 | } |
3051 | 3055 | |
3056 | + /** |
|
3057 | + * @param string $module |
|
3058 | + */ |
|
3052 | 3059 | public static function module_configuration_load( $module, $method ) { |
3053 | 3060 | $module = Jetpack::get_module_slug( $module ); |
3054 | 3061 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
3055 | 3062 | } |
3056 | 3063 | |
3064 | + /** |
|
3065 | + * @param string $module |
|
3066 | + */ |
|
3057 | 3067 | public static function module_configuration_head( $module, $method ) { |
3058 | 3068 | $module = Jetpack::get_module_slug( $module ); |
3059 | 3069 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
3060 | 3070 | } |
3061 | 3071 | |
3072 | + /** |
|
3073 | + * @param string $module |
|
3074 | + */ |
|
3062 | 3075 | public static function module_configuration_screen( $module, $method ) { |
3063 | 3076 | $module = Jetpack::get_module_slug( $module ); |
3064 | 3077 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
3065 | 3078 | } |
3066 | 3079 | |
3080 | + /** |
|
3081 | + * @param string $module |
|
3082 | + */ |
|
3067 | 3083 | public static function module_configuration_activation_screen( $module, $method ) { |
3068 | 3084 | $module = Jetpack::get_module_slug( $module ); |
3069 | 3085 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -3071,6 +3087,9 @@ discard block |
||
3071 | 3087 | |
3072 | 3088 | /* Installation */ |
3073 | 3089 | |
3090 | + /** |
|
3091 | + * @param string $message |
|
3092 | + */ |
|
3074 | 3093 | public static function bail_on_activation( $message, $deactivate = true ) { |
3075 | 3094 | ?> |
3076 | 3095 | <!doctype html> |
@@ -3831,7 +3850,7 @@ discard block |
||
3831 | 3850 | * Add help to the Jetpack page |
3832 | 3851 | * |
3833 | 3852 | * @since Jetpack (1.2.3) |
3834 | - * @return false if not the Jetpack page |
|
3853 | + * @return false|null if not the Jetpack page |
|
3835 | 3854 | */ |
3836 | 3855 | function admin_help() { |
3837 | 3856 | $current_screen = get_current_screen(); |
@@ -4762,6 +4781,9 @@ discard block |
||
4762 | 4781 | return $url; |
4763 | 4782 | } |
4764 | 4783 | |
4784 | + /** |
|
4785 | + * @return string |
|
4786 | + */ |
|
4765 | 4787 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
4766 | 4788 | $actionurl = str_replace( '&', '&', $actionurl ); |
4767 | 4789 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -4973,6 +4995,7 @@ discard block |
||
4973 | 4995 | /** |
4974 | 4996 | * Returns the requested Jetpack API URL |
4975 | 4997 | * |
4998 | + * @param string $relative_url |
|
4976 | 4999 | * @return string |
4977 | 5000 | */ |
4978 | 5001 | public static function api_url( $relative_url ) { |
@@ -5164,6 +5187,7 @@ discard block |
||
5164 | 5187 | * Note these tokens are unique per call, NOT static per site for connecting. |
5165 | 5188 | * |
5166 | 5189 | * @since 2.6 |
5190 | + * @param string $action |
|
5167 | 5191 | * @return array |
5168 | 5192 | */ |
5169 | 5193 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
@@ -5698,7 +5722,6 @@ discard block |
||
5698 | 5722 | /** |
5699 | 5723 | * Report authentication status to the WP REST API. |
5700 | 5724 | * |
5701 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5702 | 5725 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5703 | 5726 | */ |
5704 | 5727 | public function wp_rest_authentication_errors( $value ) { |
@@ -5708,6 +5731,10 @@ discard block |
||
5708 | 5731 | return $this->rest_authentication_status; |
5709 | 5732 | } |
5710 | 5733 | |
5734 | + /** |
|
5735 | + * @param integer $timestamp |
|
5736 | + * @param string $nonce |
|
5737 | + */ |
|
5711 | 5738 | function add_nonce( $timestamp, $nonce ) { |
5712 | 5739 | global $wpdb; |
5713 | 5740 | static $nonces_used_this_request = array(); |
@@ -5853,6 +5880,7 @@ discard block |
||
5853 | 5880 | * @param string $key |
5854 | 5881 | * @param string $value |
5855 | 5882 | * @param bool $restate private |
5883 | + * @return string |
|
5856 | 5884 | */ |
5857 | 5885 | public static function state( $key = null, $value = null, $restate = false ) { |
5858 | 5886 | static $state = array(); |
@@ -5909,6 +5937,9 @@ discard block |
||
5909 | 5937 | Jetpack::state( null, null, true ); |
5910 | 5938 | } |
5911 | 5939 | |
5940 | + /** |
|
5941 | + * @param string $file |
|
5942 | + */ |
|
5912 | 5943 | public static function check_privacy( $file ) { |
5913 | 5944 | static $is_site_publicly_accessible = null; |
5914 | 5945 | |
@@ -6541,9 +6572,7 @@ discard block |
||
6541 | 6572 | * |
6542 | 6573 | * Attached to `style_loader_src` filter. |
6543 | 6574 | * |
6544 | - * @param string $tag The tag that would link to the external asset. |
|
6545 | 6575 | * @param string $handle The registered handle of the script in question. |
6546 | - * @param string $href The url of the asset in question. |
|
6547 | 6576 | */ |
6548 | 6577 | public static function set_suffix_on_min( $src, $handle ) { |
6549 | 6578 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6724,8 +6753,8 @@ discard block |
||
6724 | 6753 | * - Absolute URLs `http://domain.com/feh.png` |
6725 | 6754 | * - Domain root relative URLs `/feh.png` |
6726 | 6755 | * |
6727 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6728 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6756 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6757 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6729 | 6758 | * |
6730 | 6759 | * @return mixed|string |
6731 | 6760 | */ |
@@ -6959,7 +6988,7 @@ discard block |
||
6959 | 6988 | * |
6960 | 6989 | * @param string $option_name |
6961 | 6990 | * |
6962 | - * @return bool |
|
6991 | + * @return false|null |
|
6963 | 6992 | */ |
6964 | 6993 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6965 | 6994 | // Bail if Jump Start has already been dismissed |
@@ -7000,7 +7029,7 @@ discard block |
||
7000 | 7029 | /** |
7001 | 7030 | * Stores and prints out domains to prefetch for page speed optimization. |
7002 | 7031 | * |
7003 | - * @param mixed $new_urls |
|
7032 | + * @param string[] $new_urls |
|
7004 | 7033 | */ |
7005 | 7034 | public static function dns_prefetch( $new_urls = null ) { |
7006 | 7035 | static $prefetch_urls = array(); |
@@ -7055,7 +7084,6 @@ discard block |
||
7055 | 7084 | } |
7056 | 7085 | |
7057 | 7086 | /** |
7058 | - * @param mixed $result Value for the user's option |
|
7059 | 7087 | * @return mixed |
7060 | 7088 | */ |
7061 | 7089 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -76,7 +76,6 @@ |
||
76 | 76 | * @since 5.8.0 |
77 | 77 | * |
78 | 78 | * @param string|array $key Query key or keys to remove. |
79 | - * @param bool|string $query Optional. A URL to act upon. Defaults to the current search URL. |
|
80 | 79 | * |
81 | 80 | * @return string New URL query string (unescaped). |
82 | 81 | */ |
@@ -58,6 +58,10 @@ |
||
58 | 58 | return $query->is_main_query() && $query->is_search(); |
59 | 59 | } |
60 | 60 | |
61 | + /** |
|
62 | + * @param double $duration |
|
63 | + * @param boolean $was_jetpack_search |
|
64 | + */ |
|
61 | 65 | private function record_query_time( $duration, $was_jetpack_search ) { |
62 | 66 | $this->stats[] = array( $was_jetpack_search, intval( $duration * 1000 ) ); |
63 | 67 | } |