@@ -221,7 +221,7 @@ |
||
221 | 221 | /** |
222 | 222 | * Filter and replace HTML element. |
223 | 223 | * |
224 | - * @param array $matches Array of matches. |
|
224 | + * @param string[] $matches Array of matches. |
|
225 | 225 | */ |
226 | 226 | private static function dispatch( $matches ) { |
227 | 227 | $html = preg_replace( '%�*58;//%', '://', $matches[0] ); |
@@ -271,6 +271,9 @@ discard block |
||
271 | 271 | } |
272 | 272 | } |
273 | 273 | |
274 | + /** |
|
275 | + * @param string $type |
|
276 | + */ |
|
274 | 277 | static function get_video_poster( $type, $id ) { |
275 | 278 | if ( 'videopress' == $type ) { |
276 | 279 | if ( function_exists( 'video_get_highest_resolution_image_url' ) ) { |
@@ -356,6 +359,9 @@ discard block |
||
356 | 359 | return (int) count( self::split_content_in_words( self::clean_text( $post_content ) ) ); |
357 | 360 | } |
358 | 361 | |
362 | + /** |
|
363 | + * @param string $excerpt_content |
|
364 | + */ |
|
359 | 365 | static function get_word_remaining_count( $post_content, $excerpt_content ) { |
360 | 366 | $content_word_count = count( self::split_content_in_words( self::clean_text( $post_content ) ) ); |
361 | 367 | $excerpt_word_count = count( self::split_content_in_words( self::clean_text( $excerpt_content ) ) ); |
@@ -185,6 +185,9 @@ discard block |
||
185 | 185 | do_action( 'jetpack_full_sync_end', '', $range ); |
186 | 186 | } |
187 | 187 | |
188 | + /** |
|
189 | + * @param string $type |
|
190 | + */ |
|
188 | 191 | function get_range( $type ) { |
189 | 192 | global $wpdb; |
190 | 193 | if ( ! in_array( $type, array( 'comments', 'posts' ) ) ) { |
@@ -323,6 +326,9 @@ discard block |
||
323 | 326 | $listener->get_full_sync_queue()->reset(); |
324 | 327 | } |
325 | 328 | |
329 | + /** |
|
330 | + * @param integer $default |
|
331 | + */ |
|
326 | 332 | private function get_status_option( $name, $default = null ) { |
327 | 333 | $value = Jetpack_Options::get_raw_option( self::STATUS_OPTION_PREFIX . "_$name", $default ); |
328 | 334 |
@@ -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; |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | * This is ported over from the manage module, which has been deprecated and baked in here. |
720 | 720 | * |
721 | 721 | * @param $domains |
722 | - * @return array |
|
722 | + * @return string[] |
|
723 | 723 | */ |
724 | 724 | function allow_wpcom_domain( $domains ) { |
725 | 725 | if ( empty( $domains ) ) { |
@@ -1239,7 +1239,7 @@ discard block |
||
1239 | 1239 | } |
1240 | 1240 | /** |
1241 | 1241 | * Does the network allow admins to add new users. |
1242 | - * @return boolian |
|
1242 | + * @return boolean |
|
1243 | 1243 | */ |
1244 | 1244 | static function network_add_new_users( $option = null ) { |
1245 | 1245 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1344,7 +1344,7 @@ discard block |
||
1344 | 1344 | * database which could be set to anything as opposed to what this function returns. |
1345 | 1345 | * @param bool $option |
1346 | 1346 | * |
1347 | - * @return boolean |
|
1347 | + * @return string |
|
1348 | 1348 | */ |
1349 | 1349 | public function is_main_network_option( $option ) { |
1350 | 1350 | // return '1' or '' |
@@ -1355,7 +1355,7 @@ discard block |
||
1355 | 1355 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1356 | 1356 | * |
1357 | 1357 | * @param string $option |
1358 | - * @return boolean |
|
1358 | + * @return string |
|
1359 | 1359 | */ |
1360 | 1360 | public function is_multisite( $option ) { |
1361 | 1361 | return (string) (bool) is_multisite(); |
@@ -1417,7 +1417,7 @@ discard block |
||
1417 | 1417 | |
1418 | 1418 | /** |
1419 | 1419 | * Returns true if the site has file write access false otherwise. |
1420 | - * @return string ( '1' | '0' ) |
|
1420 | + * @return integer ( '1' | '0' ) |
|
1421 | 1421 | **/ |
1422 | 1422 | public static function file_system_write_access() { |
1423 | 1423 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2148,6 +2148,7 @@ discard block |
||
2148 | 2148 | * @param int $user_id |
2149 | 2149 | * @param string $token |
2150 | 2150 | * return bool |
2151 | + * @param boolean $is_master_user |
|
2151 | 2152 | */ |
2152 | 2153 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2153 | 2154 | // not designed for concurrent updates |
@@ -2550,6 +2551,7 @@ discard block |
||
2550 | 2551 | |
2551 | 2552 | /** |
2552 | 2553 | * Like core's get_file_data implementation, but caches the result. |
2554 | + * @param string $file |
|
2553 | 2555 | */ |
2554 | 2556 | public static function get_file_data( $file, $headers ) { |
2555 | 2557 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2586,7 +2588,7 @@ discard block |
||
2586 | 2588 | * |
2587 | 2589 | * @param string $tag Tag as it appears in each module heading. |
2588 | 2590 | * |
2589 | - * @return mixed |
|
2591 | + * @return string |
|
2590 | 2592 | */ |
2591 | 2593 | public static function translate_module_tag( $tag ) { |
2592 | 2594 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2758,8 +2760,8 @@ discard block |
||
2758 | 2760 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2759 | 2761 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2760 | 2762 | * |
2761 | - * @param $string |
|
2762 | - * @return mixed |
|
2763 | + * @param string $string |
|
2764 | + * @return string|null |
|
2763 | 2765 | */ |
2764 | 2766 | public static function alias_directories( $string ) { |
2765 | 2767 | // ABSPATH has a trailing slash. |
@@ -3039,6 +3041,9 @@ discard block |
||
3039 | 3041 | return self::update_active_modules( $new ); |
3040 | 3042 | } |
3041 | 3043 | |
3044 | + /** |
|
3045 | + * @param string $module |
|
3046 | + */ |
|
3042 | 3047 | public static function enable_module_configurable( $module ) { |
3043 | 3048 | $module = Jetpack::get_module_slug( $module ); |
3044 | 3049 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3067,6 +3072,9 @@ discard block |
||
3067 | 3072 | } |
3068 | 3073 | |
3069 | 3074 | /* Installation */ |
3075 | + /** |
|
3076 | + * @param string $message |
|
3077 | + */ |
|
3070 | 3078 | public static function bail_on_activation( $message, $deactivate = true ) { |
3071 | 3079 | ?> |
3072 | 3080 | <!doctype html> |
@@ -3801,7 +3809,7 @@ discard block |
||
3801 | 3809 | * Add help to the Jetpack page |
3802 | 3810 | * |
3803 | 3811 | * @since Jetpack (1.2.3) |
3804 | - * @return false if not the Jetpack page |
|
3812 | + * @return false|null if not the Jetpack page |
|
3805 | 3813 | */ |
3806 | 3814 | function admin_help() { |
3807 | 3815 | $current_screen = get_current_screen(); |
@@ -4620,6 +4628,9 @@ discard block |
||
4620 | 4628 | return $url; |
4621 | 4629 | } |
4622 | 4630 | |
4631 | + /** |
|
4632 | + * @return string |
|
4633 | + */ |
|
4623 | 4634 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
4624 | 4635 | $actionurl = str_replace( '&', '&', $actionurl ); |
4625 | 4636 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -4679,6 +4690,7 @@ discard block |
||
4679 | 4690 | /** |
4680 | 4691 | * Returns the requested Jetpack API URL |
4681 | 4692 | * |
4693 | + * @param string $relative_url |
|
4682 | 4694 | * @return string |
4683 | 4695 | */ |
4684 | 4696 | public static function api_url( $relative_url ) { |
@@ -4870,6 +4882,7 @@ discard block |
||
4870 | 4882 | * Note these tokens are unique per call, NOT static per site for connecting. |
4871 | 4883 | * |
4872 | 4884 | * @since 2.6 |
4885 | + * @param string $action |
|
4873 | 4886 | * @return array |
4874 | 4887 | */ |
4875 | 4888 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
@@ -5409,7 +5422,6 @@ discard block |
||
5409 | 5422 | /** |
5410 | 5423 | * Report authentication status to the WP REST API. |
5411 | 5424 | * |
5412 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5413 | 5425 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5414 | 5426 | */ |
5415 | 5427 | public function wp_rest_authentication_errors( $value ) { |
@@ -5564,6 +5576,7 @@ discard block |
||
5564 | 5576 | * @param string $key |
5565 | 5577 | * @param string $value |
5566 | 5578 | * @param bool $restate private |
5579 | + * @return string |
|
5567 | 5580 | */ |
5568 | 5581 | public static function state( $key = null, $value = null, $restate = false ) { |
5569 | 5582 | static $state = array(); |
@@ -5620,6 +5633,9 @@ discard block |
||
5620 | 5633 | Jetpack::state( null, null, true ); |
5621 | 5634 | } |
5622 | 5635 | |
5636 | + /** |
|
5637 | + * @param string $file |
|
5638 | + */ |
|
5623 | 5639 | public static function check_privacy( $file ) { |
5624 | 5640 | static $is_site_publicly_accessible = null; |
5625 | 5641 | |
@@ -5702,6 +5718,9 @@ discard block |
||
5702 | 5718 | } |
5703 | 5719 | } |
5704 | 5720 | |
5721 | + /** |
|
5722 | + * @param string $url |
|
5723 | + */ |
|
5705 | 5724 | public static function staticize_subdomain( $url ) { |
5706 | 5725 | |
5707 | 5726 | // Extract hostname from URL |
@@ -6252,9 +6271,7 @@ discard block |
||
6252 | 6271 | * |
6253 | 6272 | * Attached to `style_loader_src` filter. |
6254 | 6273 | * |
6255 | - * @param string $tag The tag that would link to the external asset. |
|
6256 | 6274 | * @param string $handle The registered handle of the script in question. |
6257 | - * @param string $href The url of the asset in question. |
|
6258 | 6275 | */ |
6259 | 6276 | public static function set_suffix_on_min( $src, $handle ) { |
6260 | 6277 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6437,8 +6454,8 @@ discard block |
||
6437 | 6454 | * - Absolute URLs `http://domain.com/feh.png` |
6438 | 6455 | * - Domain root relative URLs `/feh.png` |
6439 | 6456 | * |
6440 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6441 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6457 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6458 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6442 | 6459 | * |
6443 | 6460 | * @return mixed|string |
6444 | 6461 | */ |
@@ -6672,7 +6689,7 @@ discard block |
||
6672 | 6689 | * |
6673 | 6690 | * @param string $option_name |
6674 | 6691 | * |
6675 | - * @return bool |
|
6692 | + * @return false|null |
|
6676 | 6693 | */ |
6677 | 6694 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6678 | 6695 | // Bail if Jump Start has already been dismissed |
@@ -6713,7 +6730,7 @@ discard block |
||
6713 | 6730 | /** |
6714 | 6731 | * Stores and prints out domains to prefetch for page speed optimization. |
6715 | 6732 | * |
6716 | - * @param mixed $new_urls |
|
6733 | + * @param string[] $new_urls |
|
6717 | 6734 | */ |
6718 | 6735 | public static function dns_prefetch( $new_urls = null ) { |
6719 | 6736 | static $prefetch_urls = array(); |
@@ -6768,7 +6785,6 @@ discard block |
||
6768 | 6785 | } |
6769 | 6786 | |
6770 | 6787 | /** |
6771 | - * @param mixed $result Value for the user's option |
|
6772 | 6788 | * @return mixed |
6773 | 6789 | */ |
6774 | 6790 | function get_user_option_meta_box_order_dashboard( $sorted ) { |