@@ -148,6 +148,7 @@ discard block |
||
148 | 148 | * Helper function that is used when getting home or siteurl values. Decides |
149 | 149 | * whether to get the raw or filtered value. |
150 | 150 | * |
151 | + * @param string $url_type |
|
151 | 152 | * @return string |
152 | 153 | */ |
153 | 154 | public static function get_raw_or_filtered_url( $url_type ) { |
@@ -197,6 +198,9 @@ discard block |
||
197 | 198 | return self::get_protocol_normalized_url( 'main_network_site_url', network_site_url() ); |
198 | 199 | } |
199 | 200 | |
201 | + /** |
|
202 | + * @param string $callable |
|
203 | + */ |
|
200 | 204 | public static function get_protocol_normalized_url( $callable, $new_value ) { |
201 | 205 | $option_key = self::HTTPS_CHECK_OPTION_PREFIX . $callable; |
202 | 206 | |
@@ -236,6 +240,9 @@ discard block |
||
236 | 240 | return $value; |
237 | 241 | } |
238 | 242 | |
243 | + /** |
|
244 | + * @param string $url_function |
|
245 | + */ |
|
239 | 246 | public static function normalize_www_in_url( $option, $url_function ) { |
240 | 247 | $url = wp_parse_url( call_user_func( $url_function ) ); |
241 | 248 | $option_url = wp_parse_url( get_option( $option ) ); |
@@ -16,6 +16,9 @@ |
||
16 | 16 | */ |
17 | 17 | class Jetpack_Sitemap_Buffer_Image extends Jetpack_Sitemap_Buffer { |
18 | 18 | |
19 | + /** |
|
20 | + * @param integer $byte_limit |
|
21 | + */ |
|
19 | 22 | public function __construct( $item_limit, $byte_limit, $time = '1970-01-01 00:00:00' ) { |
20 | 23 | parent::__construct( $item_limit, $byte_limit, $time ); |
21 | 24 |
@@ -16,6 +16,9 @@ |
||
16 | 16 | */ |
17 | 17 | class Jetpack_Sitemap_Buffer_Master extends Jetpack_Sitemap_Buffer { |
18 | 18 | |
19 | + /** |
|
20 | + * @param integer $byte_limit |
|
21 | + */ |
|
19 | 22 | public function __construct( $item_limit, $byte_limit, $time = '1970-01-01 00:00:00' ) { |
20 | 23 | parent::__construct( $item_limit, $byte_limit, $time ); |
21 | 24 |
@@ -16,6 +16,9 @@ |
||
16 | 16 | */ |
17 | 17 | class Jetpack_Sitemap_Buffer_News extends Jetpack_Sitemap_Buffer { |
18 | 18 | |
19 | + /** |
|
20 | + * @param integer $byte_limit |
|
21 | + */ |
|
19 | 22 | public function __construct( $item_limit, $byte_limit, $time = '1970-01-01 00:00:00' ) { |
20 | 23 | parent::__construct( $item_limit, $byte_limit, $time ); |
21 | 24 |
@@ -16,6 +16,9 @@ |
||
16 | 16 | */ |
17 | 17 | class Jetpack_Sitemap_Buffer_Page extends Jetpack_Sitemap_Buffer { |
18 | 18 | |
19 | + /** |
|
20 | + * @param integer $byte_limit |
|
21 | + */ |
|
19 | 22 | public function __construct( $item_limit, $byte_limit, $time = '1970-01-01 00:00:00' ) { |
20 | 23 | parent::__construct( $item_limit, $byte_limit, $time ); |
21 | 24 |
@@ -16,6 +16,9 @@ |
||
16 | 16 | */ |
17 | 17 | class Jetpack_Sitemap_Buffer_Video extends Jetpack_Sitemap_Buffer { |
18 | 18 | |
19 | + /** |
|
20 | + * @param integer $byte_limit |
|
21 | + */ |
|
19 | 22 | public function __construct( $item_limit, $byte_limit, $time = '1970-01-01 00:00:00' ) { |
20 | 23 | parent::__construct( $item_limit, $byte_limit, $time ); |
21 | 24 |
@@ -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; |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | } |
942 | 942 | /** |
943 | 943 | * Does the network allow admins to add new users. |
944 | - * @return boolian |
|
944 | + * @return boolean |
|
945 | 945 | */ |
946 | 946 | static function network_add_new_users( $option = null ) { |
947 | 947 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | * database which could be set to anything as opposed to what this function returns. |
1047 | 1047 | * @param bool $option |
1048 | 1048 | * |
1049 | - * @return boolean |
|
1049 | + * @return string |
|
1050 | 1050 | */ |
1051 | 1051 | public function is_main_network_option( $option ) { |
1052 | 1052 | // return '1' or '' |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1058 | 1058 | * |
1059 | 1059 | * @param string $option |
1060 | - * @return boolean |
|
1060 | + * @return string |
|
1061 | 1061 | */ |
1062 | 1062 | public function is_multisite( $option ) { |
1063 | 1063 | return (string) (bool) is_multisite(); |
@@ -1119,7 +1119,7 @@ discard block |
||
1119 | 1119 | |
1120 | 1120 | /** |
1121 | 1121 | * Returns true if the site has file write access false otherwise. |
1122 | - * @return string ( '1' | '0' ) |
|
1122 | + * @return integer ( '1' | '0' ) |
|
1123 | 1123 | **/ |
1124 | 1124 | public static function file_system_write_access() { |
1125 | 1125 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1358,6 +1358,7 @@ discard block |
||
1358 | 1358 | * @access public |
1359 | 1359 | * @static |
1360 | 1360 | * |
1361 | + * @param string $feature |
|
1361 | 1362 | * @return bool True if plan supports feature, false if not |
1362 | 1363 | */ |
1363 | 1364 | public static function active_plan_supports( $feature ) { |
@@ -1894,6 +1895,7 @@ discard block |
||
1894 | 1895 | * @param int $user_id |
1895 | 1896 | * @param string $token |
1896 | 1897 | * return bool |
1898 | + * @param boolean $is_master_user |
|
1897 | 1899 | */ |
1898 | 1900 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
1899 | 1901 | // not designed for concurrent updates |
@@ -2288,6 +2290,7 @@ discard block |
||
2288 | 2290 | |
2289 | 2291 | /** |
2290 | 2292 | * Like core's get_file_data implementation, but caches the result. |
2293 | + * @param string $file |
|
2291 | 2294 | */ |
2292 | 2295 | public static function get_file_data( $file, $headers ) { |
2293 | 2296 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2333,7 +2336,7 @@ discard block |
||
2333 | 2336 | * |
2334 | 2337 | * @param string $tag Tag as it appears in each module heading. |
2335 | 2338 | * |
2336 | - * @return mixed |
|
2339 | + * @return string |
|
2337 | 2340 | */ |
2338 | 2341 | public static function translate_module_tag( $tag ) { |
2339 | 2342 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2346,7 +2349,7 @@ discard block |
||
2346 | 2349 | * |
2347 | 2350 | * @param array $modules |
2348 | 2351 | * |
2349 | - * @return string|void |
|
2352 | + * @return string |
|
2350 | 2353 | */ |
2351 | 2354 | public static function get_translated_modules( $modules ) { |
2352 | 2355 | foreach ( $modules as $index => $module ) { |
@@ -2436,8 +2439,8 @@ discard block |
||
2436 | 2439 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2437 | 2440 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2438 | 2441 | * |
2439 | - * @param $string |
|
2440 | - * @return mixed |
|
2442 | + * @param string $string |
|
2443 | + * @return string|null |
|
2441 | 2444 | */ |
2442 | 2445 | public static function alias_directories( $string ) { |
2443 | 2446 | // ABSPATH has a trailing slash. |
@@ -2692,6 +2695,9 @@ discard block |
||
2692 | 2695 | return self::update_active_modules( $new ); |
2693 | 2696 | } |
2694 | 2697 | |
2698 | + /** |
|
2699 | + * @param string $module |
|
2700 | + */ |
|
2695 | 2701 | public static function enable_module_configurable( $module ) { |
2696 | 2702 | $module = Jetpack::get_module_slug( $module ); |
2697 | 2703 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2702,21 +2708,33 @@ discard block |
||
2702 | 2708 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2703 | 2709 | } |
2704 | 2710 | |
2711 | + /** |
|
2712 | + * @param string $module |
|
2713 | + */ |
|
2705 | 2714 | public static function module_configuration_load( $module, $method ) { |
2706 | 2715 | $module = Jetpack::get_module_slug( $module ); |
2707 | 2716 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2708 | 2717 | } |
2709 | 2718 | |
2719 | + /** |
|
2720 | + * @param string $module |
|
2721 | + */ |
|
2710 | 2722 | public static function module_configuration_head( $module, $method ) { |
2711 | 2723 | $module = Jetpack::get_module_slug( $module ); |
2712 | 2724 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2713 | 2725 | } |
2714 | 2726 | |
2727 | + /** |
|
2728 | + * @param string $module |
|
2729 | + */ |
|
2715 | 2730 | public static function module_configuration_screen( $module, $method ) { |
2716 | 2731 | $module = Jetpack::get_module_slug( $module ); |
2717 | 2732 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2718 | 2733 | } |
2719 | 2734 | |
2735 | + /** |
|
2736 | + * @param string $module |
|
2737 | + */ |
|
2720 | 2738 | public static function module_configuration_activation_screen( $module, $method ) { |
2721 | 2739 | $module = Jetpack::get_module_slug( $module ); |
2722 | 2740 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2724,6 +2742,9 @@ discard block |
||
2724 | 2742 | |
2725 | 2743 | /* Installation */ |
2726 | 2744 | |
2745 | + /** |
|
2746 | + * @param string $message |
|
2747 | + */ |
|
2727 | 2748 | public static function bail_on_activation( $message, $deactivate = true ) { |
2728 | 2749 | ?> |
2729 | 2750 | <!doctype html> |
@@ -3423,7 +3444,7 @@ discard block |
||
3423 | 3444 | * Add help to the Jetpack page |
3424 | 3445 | * |
3425 | 3446 | * @since Jetpack (1.2.3) |
3426 | - * @return false if not the Jetpack page |
|
3447 | + * @return false|null if not the Jetpack page |
|
3427 | 3448 | */ |
3428 | 3449 | function admin_help() { |
3429 | 3450 | $current_screen = get_current_screen(); |
@@ -4438,6 +4459,7 @@ discard block |
||
4438 | 4459 | /** |
4439 | 4460 | * Returns the requested Jetpack API URL |
4440 | 4461 | * |
4462 | + * @param string $relative_url |
|
4441 | 4463 | * @return string |
4442 | 4464 | */ |
4443 | 4465 | public static function api_url( $relative_url ) { |
@@ -4582,7 +4604,8 @@ discard block |
||
4582 | 4604 | * Note these tokens are unique per call, NOT static per site for connecting. |
4583 | 4605 | * |
4584 | 4606 | * @since 2.6 |
4585 | - * @return array |
|
4607 | + * @param string $action |
|
4608 | + * @return boolean |
|
4586 | 4609 | */ |
4587 | 4610 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
4588 | 4611 | if ( ! $user_id ) { |
@@ -5061,7 +5084,6 @@ discard block |
||
5061 | 5084 | /** |
5062 | 5085 | * Report authentication status to the WP REST API. |
5063 | 5086 | * |
5064 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5065 | 5087 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5066 | 5088 | */ |
5067 | 5089 | public function wp_rest_authentication_errors( $value ) { |
@@ -5071,6 +5093,10 @@ discard block |
||
5071 | 5093 | return $this->rest_authentication_status; |
5072 | 5094 | } |
5073 | 5095 | |
5096 | + /** |
|
5097 | + * @param integer $timestamp |
|
5098 | + * @param string $nonce |
|
5099 | + */ |
|
5074 | 5100 | function add_nonce( $timestamp, $nonce ) { |
5075 | 5101 | global $wpdb; |
5076 | 5102 | static $nonces_used_this_request = array(); |
@@ -5216,6 +5242,7 @@ discard block |
||
5216 | 5242 | * @param string $key |
5217 | 5243 | * @param string $value |
5218 | 5244 | * @param bool $restate private |
5245 | + * @return string |
|
5219 | 5246 | */ |
5220 | 5247 | public static function state( $key = null, $value = null, $restate = false ) { |
5221 | 5248 | static $state = array(); |
@@ -5272,6 +5299,9 @@ discard block |
||
5272 | 5299 | Jetpack::state( null, null, true ); |
5273 | 5300 | } |
5274 | 5301 | |
5302 | + /** |
|
5303 | + * @param string $file |
|
5304 | + */ |
|
5275 | 5305 | public static function check_privacy( $file ) { |
5276 | 5306 | static $is_site_publicly_accessible = null; |
5277 | 5307 | |
@@ -5867,9 +5897,7 @@ discard block |
||
5867 | 5897 | * |
5868 | 5898 | * Attached to `style_loader_src` filter. |
5869 | 5899 | * |
5870 | - * @param string $tag The tag that would link to the external asset. |
|
5871 | 5900 | * @param string $handle The registered handle of the script in question. |
5872 | - * @param string $href The url of the asset in question. |
|
5873 | 5901 | */ |
5874 | 5902 | public static function set_suffix_on_min( $src, $handle ) { |
5875 | 5903 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6038,8 +6066,8 @@ discard block |
||
6038 | 6066 | * - Absolute URLs `http://domain.com/feh.png` |
6039 | 6067 | * - Domain root relative URLs `/feh.png` |
6040 | 6068 | * |
6041 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6042 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6069 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6070 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6043 | 6071 | * |
6044 | 6072 | * @return mixed|string |
6045 | 6073 | */ |
@@ -6330,7 +6358,7 @@ discard block |
||
6330 | 6358 | * |
6331 | 6359 | * @param string $option_name |
6332 | 6360 | * |
6333 | - * @return bool |
|
6361 | + * @return false|null |
|
6334 | 6362 | */ |
6335 | 6363 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6336 | 6364 | // Bail if Jump Start has already been dismissed |
@@ -6421,7 +6449,6 @@ discard block |
||
6421 | 6449 | } |
6422 | 6450 | |
6423 | 6451 | /** |
6424 | - * @param mixed $result Value for the user's option |
|
6425 | 6452 | * @return mixed |
6426 | 6453 | */ |
6427 | 6454 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -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' ) ) { |