@@ -129,6 +129,9 @@ discard block |
||
129 | 129 | return apply_filters( 'jp_carousel_load_for_images_linked_to_file', false ); |
130 | 130 | } |
131 | 131 | |
132 | + /** |
|
133 | + * @param string $version |
|
134 | + */ |
|
132 | 135 | function asset_version( $version ) { |
133 | 136 | /** |
134 | 137 | * Filter the version string used when enqueuing Carousel assets. |
@@ -496,6 +499,9 @@ discard block |
||
496 | 499 | return $attr; |
497 | 500 | } |
498 | 501 | |
502 | + /** |
|
503 | + * @param string $html |
|
504 | + */ |
|
499 | 505 | function add_data_to_container( $html ) { |
500 | 506 | global $post; |
501 | 507 | if ( Jetpack_AMP_Support::is_amp_request() ) { |
@@ -739,6 +745,9 @@ discard block |
||
739 | 745 | return ( 1 == $value ) ? 1 : 0; |
740 | 746 | } |
741 | 747 | |
748 | + /** |
|
749 | + * @param string $name |
|
750 | + */ |
|
742 | 751 | function settings_checkbox( $name, $label_text, $extra_text = '', $default_to_checked = true ) { |
743 | 752 | if ( empty( $name ) ) { |
744 | 753 | return; |
@@ -754,6 +763,9 @@ discard block |
||
754 | 763 | echo '</fieldset>'; |
755 | 764 | } |
756 | 765 | |
766 | + /** |
|
767 | + * @param string $name |
|
768 | + */ |
|
757 | 769 | function settings_select( $name, $values, $extra_text = '' ) { |
758 | 770 | if ( empty( $name ) || ! is_array( $values ) || empty( $values ) ) { |
759 | 771 | return; |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | * This is ported over from the manage module, which has been deprecated and baked in here. |
717 | 717 | * |
718 | 718 | * @param $domains |
719 | - * @return array |
|
719 | + * @return string[] |
|
720 | 720 | */ |
721 | 721 | function allow_wpcom_domain( $domains ) { |
722 | 722 | if ( empty( $domains ) ) { |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | } |
1237 | 1237 | /** |
1238 | 1238 | * Does the network allow admins to add new users. |
1239 | - * @return boolian |
|
1239 | + * @return boolean |
|
1240 | 1240 | */ |
1241 | 1241 | static function network_add_new_users( $option = null ) { |
1242 | 1242 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1341,7 +1341,7 @@ discard block |
||
1341 | 1341 | * database which could be set to anything as opposed to what this function returns. |
1342 | 1342 | * @param bool $option |
1343 | 1343 | * |
1344 | - * @return boolean |
|
1344 | + * @return string |
|
1345 | 1345 | */ |
1346 | 1346 | public function is_main_network_option( $option ) { |
1347 | 1347 | // return '1' or '' |
@@ -1352,7 +1352,7 @@ discard block |
||
1352 | 1352 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1353 | 1353 | * |
1354 | 1354 | * @param string $option |
1355 | - * @return boolean |
|
1355 | + * @return string |
|
1356 | 1356 | */ |
1357 | 1357 | public function is_multisite( $option ) { |
1358 | 1358 | return (string) (bool) is_multisite(); |
@@ -1414,7 +1414,7 @@ discard block |
||
1414 | 1414 | |
1415 | 1415 | /** |
1416 | 1416 | * Returns true if the site has file write access false otherwise. |
1417 | - * @return string ( '1' | '0' ) |
|
1417 | + * @return integer ( '1' | '0' ) |
|
1418 | 1418 | **/ |
1419 | 1419 | public static function file_system_write_access() { |
1420 | 1420 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2145,6 +2145,7 @@ discard block |
||
2145 | 2145 | * @param int $user_id |
2146 | 2146 | * @param string $token |
2147 | 2147 | * return bool |
2148 | + * @param boolean $is_master_user |
|
2148 | 2149 | */ |
2149 | 2150 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2150 | 2151 | // not designed for concurrent updates |
@@ -2547,6 +2548,7 @@ discard block |
||
2547 | 2548 | |
2548 | 2549 | /** |
2549 | 2550 | * Like core's get_file_data implementation, but caches the result. |
2551 | + * @param string $file |
|
2550 | 2552 | */ |
2551 | 2553 | public static function get_file_data( $file, $headers ) { |
2552 | 2554 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2583,7 +2585,7 @@ discard block |
||
2583 | 2585 | * |
2584 | 2586 | * @param string $tag Tag as it appears in each module heading. |
2585 | 2587 | * |
2586 | - * @return mixed |
|
2588 | + * @return string |
|
2587 | 2589 | */ |
2588 | 2590 | public static function translate_module_tag( $tag ) { |
2589 | 2591 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2755,8 +2757,8 @@ discard block |
||
2755 | 2757 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2756 | 2758 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2757 | 2759 | * |
2758 | - * @param $string |
|
2759 | - * @return mixed |
|
2760 | + * @param string $string |
|
2761 | + * @return string|null |
|
2760 | 2762 | */ |
2761 | 2763 | public static function alias_directories( $string ) { |
2762 | 2764 | // ABSPATH has a trailing slash. |
@@ -3016,6 +3018,9 @@ discard block |
||
3016 | 3018 | return self::update_active_modules( $new ); |
3017 | 3019 | } |
3018 | 3020 | |
3021 | + /** |
|
3022 | + * @param string $module |
|
3023 | + */ |
|
3019 | 3024 | public static function enable_module_configurable( $module ) { |
3020 | 3025 | $module = Jetpack::get_module_slug( $module ); |
3021 | 3026 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3044,6 +3049,9 @@ discard block |
||
3044 | 3049 | } |
3045 | 3050 | |
3046 | 3051 | /* Installation */ |
3052 | + /** |
|
3053 | + * @param string $message |
|
3054 | + */ |
|
3047 | 3055 | public static function bail_on_activation( $message, $deactivate = true ) { |
3048 | 3056 | ?> |
3049 | 3057 | <!doctype html> |
@@ -3778,7 +3786,7 @@ discard block |
||
3778 | 3786 | * Add help to the Jetpack page |
3779 | 3787 | * |
3780 | 3788 | * @since Jetpack (1.2.3) |
3781 | - * @return false if not the Jetpack page |
|
3789 | + * @return false|null if not the Jetpack page |
|
3782 | 3790 | */ |
3783 | 3791 | function admin_help() { |
3784 | 3792 | $current_screen = get_current_screen(); |
@@ -4597,6 +4605,9 @@ discard block |
||
4597 | 4605 | return $url; |
4598 | 4606 | } |
4599 | 4607 | |
4608 | + /** |
|
4609 | + * @return string |
|
4610 | + */ |
|
4600 | 4611 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
4601 | 4612 | $actionurl = str_replace( '&', '&', $actionurl ); |
4602 | 4613 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -4656,6 +4667,7 @@ discard block |
||
4656 | 4667 | /** |
4657 | 4668 | * Returns the requested Jetpack API URL |
4658 | 4669 | * |
4670 | + * @param string $relative_url |
|
4659 | 4671 | * @return string |
4660 | 4672 | */ |
4661 | 4673 | public static function api_url( $relative_url ) { |
@@ -4847,7 +4859,8 @@ discard block |
||
4847 | 4859 | * Note these tokens are unique per call, NOT static per site for connecting. |
4848 | 4860 | * |
4849 | 4861 | * @since 2.6 |
4850 | - * @return array |
|
4862 | + * @param string $action |
|
4863 | + * @return boolean |
|
4851 | 4864 | */ |
4852 | 4865 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
4853 | 4866 | if ( ! $user_id ) { |
@@ -5381,7 +5394,6 @@ discard block |
||
5381 | 5394 | /** |
5382 | 5395 | * Report authentication status to the WP REST API. |
5383 | 5396 | * |
5384 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5385 | 5397 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5386 | 5398 | */ |
5387 | 5399 | public function wp_rest_authentication_errors( $value ) { |
@@ -5391,6 +5403,10 @@ discard block |
||
5391 | 5403 | return $this->rest_authentication_status; |
5392 | 5404 | } |
5393 | 5405 | |
5406 | + /** |
|
5407 | + * @param integer $timestamp |
|
5408 | + * @param string $nonce |
|
5409 | + */ |
|
5394 | 5410 | function add_nonce( $timestamp, $nonce ) { |
5395 | 5411 | global $wpdb; |
5396 | 5412 | static $nonces_used_this_request = array(); |
@@ -5536,6 +5552,7 @@ discard block |
||
5536 | 5552 | * @param string $key |
5537 | 5553 | * @param string $value |
5538 | 5554 | * @param bool $restate private |
5555 | + * @return string |
|
5539 | 5556 | */ |
5540 | 5557 | public static function state( $key = null, $value = null, $restate = false ) { |
5541 | 5558 | static $state = array(); |
@@ -5592,6 +5609,9 @@ discard block |
||
5592 | 5609 | Jetpack::state( null, null, true ); |
5593 | 5610 | } |
5594 | 5611 | |
5612 | + /** |
|
5613 | + * @param string $file |
|
5614 | + */ |
|
5595 | 5615 | public static function check_privacy( $file ) { |
5596 | 5616 | static $is_site_publicly_accessible = null; |
5597 | 5617 | |
@@ -5674,6 +5694,9 @@ discard block |
||
5674 | 5694 | } |
5675 | 5695 | } |
5676 | 5696 | |
5697 | + /** |
|
5698 | + * @param string $url |
|
5699 | + */ |
|
5677 | 5700 | public static function staticize_subdomain( $url ) { |
5678 | 5701 | |
5679 | 5702 | // Extract hostname from URL |
@@ -6224,9 +6247,7 @@ discard block |
||
6224 | 6247 | * |
6225 | 6248 | * Attached to `style_loader_src` filter. |
6226 | 6249 | * |
6227 | - * @param string $tag The tag that would link to the external asset. |
|
6228 | 6250 | * @param string $handle The registered handle of the script in question. |
6229 | - * @param string $href The url of the asset in question. |
|
6230 | 6251 | */ |
6231 | 6252 | public static function set_suffix_on_min( $src, $handle ) { |
6232 | 6253 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6409,8 +6430,8 @@ discard block |
||
6409 | 6430 | * - Absolute URLs `http://domain.com/feh.png` |
6410 | 6431 | * - Domain root relative URLs `/feh.png` |
6411 | 6432 | * |
6412 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6413 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6433 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6434 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6414 | 6435 | * |
6415 | 6436 | * @return mixed|string |
6416 | 6437 | */ |
@@ -6653,7 +6674,7 @@ discard block |
||
6653 | 6674 | /** |
6654 | 6675 | * Stores and prints out domains to prefetch for page speed optimization. |
6655 | 6676 | * |
6656 | - * @param mixed $new_urls |
|
6677 | + * @param string[] $new_urls |
|
6657 | 6678 | */ |
6658 | 6679 | public static function dns_prefetch( $new_urls = null ) { |
6659 | 6680 | static $prefetch_urls = array(); |
@@ -6708,7 +6729,6 @@ discard block |
||
6708 | 6729 | } |
6709 | 6730 | |
6710 | 6731 | /** |
6711 | - * @param mixed $result Value for the user's option |
|
6712 | 6732 | * @return mixed |
6713 | 6733 | */ |
6714 | 6734 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -337,6 +337,9 @@ discard block |
||
337 | 337 | return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); |
338 | 338 | } |
339 | 339 | |
340 | + /** |
|
341 | + * @param integer $status_code |
|
342 | + */ |
|
340 | 343 | function output_early( $status_code, $response = null, $content_type = 'application/json' ) { |
341 | 344 | $exit = $this->exit; |
342 | 345 | $this->exit = false; |
@@ -545,11 +548,18 @@ discard block |
||
545 | 548 | return json_encode( $data ); |
546 | 549 | } |
547 | 550 | |
551 | + /** |
|
552 | + * @param string $needle |
|
553 | + */ |
|
548 | 554 | function ends_with( $haystack, $needle ) { |
549 | 555 | return $needle === substr( $haystack, -strlen( $needle ) ); |
550 | 556 | } |
551 | 557 | |
552 | 558 | // Returns the site's blog_id in the WP.com ecosystem |
559 | + |
|
560 | + /** |
|
561 | + * @return integer |
|
562 | + */ |
|
553 | 563 | function get_blog_id_for_output() { |
554 | 564 | return $this->token_details['blog_id']; |
555 | 565 | } |
@@ -572,6 +582,10 @@ discard block |
||
572 | 582 | } |
573 | 583 | |
574 | 584 | // Returns true if the specified blog ID is a restricted blog |
585 | + |
|
586 | + /** |
|
587 | + * @param integer $blog_id |
|
588 | + */ |
|
575 | 589 | function is_restricted_blog( $blog_id ) { |
576 | 590 | /** |
577 | 591 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |
@@ -621,7 +635,7 @@ discard block |
||
621 | 635 | /** |
622 | 636 | * Counts the number of comments on a site, excluding certain comment types. |
623 | 637 | * |
624 | - * @param $post_id int Post ID. |
|
638 | + * @param integer $post_id int Post ID. |
|
625 | 639 | * @return array Array of counts, matching the output of https://developer.wordpress.org/reference/functions/get_comment_count/. |
626 | 640 | */ |
627 | 641 | public function wp_count_comments( $post_id ) { |