@@ -213,7 +213,6 @@ discard block |
||
| 213 | 213 | /** |
| 214 | 214 | * Inject image sizes to Jetpack REST API responses. This wraps the filter_photon_norezise_maybe_inject_sizes function. |
| 215 | 215 | * |
| 216 | - * @param array $data Attachment sizes data. |
|
| 217 | 216 | * @param int $attachment_id Attachment's post ID. |
| 218 | 217 | * |
| 219 | 218 | * @return array Attachment sizes array. |
@@ -1257,7 +1256,7 @@ discard block |
||
| 1257 | 1256 | * after ourselves without breaking anyone else's filters. |
| 1258 | 1257 | * |
| 1259 | 1258 | * @internal |
| 1260 | - * @return true |
|
| 1259 | + * @return boolean |
|
| 1261 | 1260 | */ |
| 1262 | 1261 | public function _override_image_downsize_in_rest_edit_context() { |
| 1263 | 1262 | return true; |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | /** |
| 53 | 53 | * Helper function to look up the expected master user and return the local WP_User. |
| 54 | 54 | * |
| 55 | - * @return WP_User Jetpack's expected master user. |
|
| 55 | + * @return string Jetpack's expected master user. |
|
| 56 | 56 | */ |
| 57 | 57 | protected function helper_retrieve_local_master_user() { |
| 58 | 58 | $master_user = Jetpack_Options::get_option( 'master_user' ); |
@@ -162,6 +162,7 @@ discard block |
||
| 162 | 162 | /** |
| 163 | 163 | * Get attachment images for a specified post and return them. Also make sure |
| 164 | 164 | * their dimensions are at or above a required minimum. |
| 165 | + * @param integer $post_id |
|
| 165 | 166 | */ |
| 166 | 167 | static function from_attachment( $post_id, $width = 200, $height = 200 ) { |
| 167 | 168 | $images = array(); |
@@ -224,7 +225,7 @@ discard block |
||
| 224 | 225 | * Check if a Featured Image is set for this post, and return it in a similar |
| 225 | 226 | * format to the other images?_from_*() methods. |
| 226 | 227 | * @param int $post_id The post ID to check |
| 227 | - * @return Array containing details of the Featured Image, or empty array if none. |
|
| 228 | + * @return integer|null containing details of the Featured Image, or empty array if none. |
|
| 228 | 229 | */ |
| 229 | 230 | static function from_thumbnail( $post_id, $width = 200, $height = 200 ) { |
| 230 | 231 | $images = array(); |
@@ -668,7 +669,6 @@ discard block |
||
| 668 | 669 | * resized and cropped image. |
| 669 | 670 | * |
| 670 | 671 | * @param string $src |
| 671 | - * @param int $dimension |
|
| 672 | 672 | * @return string Transformed image URL |
| 673 | 673 | */ |
| 674 | 674 | static function fit_image_url( $src, $width, $height ) { |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | * |
| 716 | 716 | * @param mixed $html_or_id The HTML string to parse for images, or a post id. |
| 717 | 717 | * |
| 718 | - * @return array $html_info { |
|
| 718 | + * @return integer $html_info { |
|
| 719 | 719 | * @type string $html Post content. |
| 720 | 720 | * @type string $post_url Post URL. |
| 721 | 721 | * } |
@@ -244,6 +244,9 @@ |
||
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | + /** |
|
| 248 | + * @param string $capability |
|
| 249 | + */ |
|
| 247 | 250 | protected function current_user_can( $capability, $plugin = null ) { |
| 248 | 251 | if ( $plugin ) { |
| 249 | 252 | return current_user_can( $capability, $plugin ); |
@@ -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 ) ) { |
@@ -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 ) ) ); |
@@ -416,7 +416,7 @@ |
||
| 416 | 416 | * Only enqueue block assets when needed. |
| 417 | 417 | * |
| 418 | 418 | * @param string $type Slug of the block. |
| 419 | - * @param array $script_dependencies Script dependencies. Will be merged with automatically |
|
| 419 | + * @param string[] $script_dependencies Script dependencies. Will be merged with automatically |
|
| 420 | 420 | * detected script dependencies from the webpack build. |
| 421 | 421 | * |
| 422 | 422 | * @return void |
@@ -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 ) { |
@@ -5404,7 +5417,6 @@ discard block |
||
| 5404 | 5417 | /** |
| 5405 | 5418 | * Report authentication status to the WP REST API. |
| 5406 | 5419 | * |
| 5407 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
| 5408 | 5420 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
| 5409 | 5421 | */ |
| 5410 | 5422 | public function wp_rest_authentication_errors( $value ) { |
@@ -5414,6 +5426,10 @@ discard block |
||
| 5414 | 5426 | return $this->rest_authentication_status; |
| 5415 | 5427 | } |
| 5416 | 5428 | |
| 5429 | + /** |
|
| 5430 | + * @param integer $timestamp |
|
| 5431 | + * @param string $nonce |
|
| 5432 | + */ |
|
| 5417 | 5433 | function add_nonce( $timestamp, $nonce ) { |
| 5418 | 5434 | global $wpdb; |
| 5419 | 5435 | static $nonces_used_this_request = array(); |
@@ -5559,6 +5575,7 @@ discard block |
||
| 5559 | 5575 | * @param string $key |
| 5560 | 5576 | * @param string $value |
| 5561 | 5577 | * @param bool $restate private |
| 5578 | + * @return string |
|
| 5562 | 5579 | */ |
| 5563 | 5580 | public static function state( $key = null, $value = null, $restate = false ) { |
| 5564 | 5581 | static $state = array(); |
@@ -5615,6 +5632,9 @@ discard block |
||
| 5615 | 5632 | Jetpack::state( null, null, true ); |
| 5616 | 5633 | } |
| 5617 | 5634 | |
| 5635 | + /** |
|
| 5636 | + * @param string $file |
|
| 5637 | + */ |
|
| 5618 | 5638 | public static function check_privacy( $file ) { |
| 5619 | 5639 | static $is_site_publicly_accessible = null; |
| 5620 | 5640 | |
@@ -5697,6 +5717,9 @@ discard block |
||
| 5697 | 5717 | } |
| 5698 | 5718 | } |
| 5699 | 5719 | |
| 5720 | + /** |
|
| 5721 | + * @param string $url |
|
| 5722 | + */ |
|
| 5700 | 5723 | public static function staticize_subdomain( $url ) { |
| 5701 | 5724 | |
| 5702 | 5725 | // Extract hostname from URL |
@@ -6247,9 +6270,7 @@ discard block |
||
| 6247 | 6270 | * |
| 6248 | 6271 | * Attached to `style_loader_src` filter. |
| 6249 | 6272 | * |
| 6250 | - * @param string $tag The tag that would link to the external asset. |
|
| 6251 | 6273 | * @param string $handle The registered handle of the script in question. |
| 6252 | - * @param string $href The url of the asset in question. |
|
| 6253 | 6274 | */ |
| 6254 | 6275 | public static function set_suffix_on_min( $src, $handle ) { |
| 6255 | 6276 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6432,8 +6453,8 @@ discard block |
||
| 6432 | 6453 | * - Absolute URLs `http://domain.com/feh.png` |
| 6433 | 6454 | * - Domain root relative URLs `/feh.png` |
| 6434 | 6455 | * |
| 6435 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 6436 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6456 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 6457 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6437 | 6458 | * |
| 6438 | 6459 | * @return mixed|string |
| 6439 | 6460 | */ |
@@ -6667,7 +6688,7 @@ discard block |
||
| 6667 | 6688 | * |
| 6668 | 6689 | * @param string $option_name |
| 6669 | 6690 | * |
| 6670 | - * @return bool |
|
| 6691 | + * @return false|null |
|
| 6671 | 6692 | */ |
| 6672 | 6693 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
| 6673 | 6694 | // Bail if Jump Start has already been dismissed |
@@ -6708,7 +6729,7 @@ discard block |
||
| 6708 | 6729 | /** |
| 6709 | 6730 | * Stores and prints out domains to prefetch for page speed optimization. |
| 6710 | 6731 | * |
| 6711 | - * @param mixed $new_urls |
|
| 6732 | + * @param string[] $new_urls |
|
| 6712 | 6733 | */ |
| 6713 | 6734 | public static function dns_prefetch( $new_urls = null ) { |
| 6714 | 6735 | static $prefetch_urls = array(); |
@@ -6763,7 +6784,6 @@ discard block |
||
| 6763 | 6784 | } |
| 6764 | 6785 | |
| 6765 | 6786 | /** |
| 6766 | - * @param mixed $result Value for the user's option |
|
| 6767 | 6787 | * @return mixed |
| 6768 | 6788 | */ |
| 6769 | 6789 | function get_user_option_meta_box_order_dashboard( $sorted ) { |