@@ -153,6 +153,7 @@ discard block |
||
153 | 153 | /** |
154 | 154 | * Get attachment images for a specified post and return them. Also make sure |
155 | 155 | * their dimensions are at or above a required minimum. |
156 | + * @param integer $post_id |
|
156 | 157 | */ |
157 | 158 | static function from_attachment( $post_id, $width = 200, $height = 200 ) { |
158 | 159 | $images = array(); |
@@ -545,7 +546,6 @@ discard block |
||
545 | 546 | * resized and cropped image. |
546 | 547 | * |
547 | 548 | * @param string $src |
548 | - * @param int $dimension |
|
549 | 549 | * @return string Transformed image URL |
550 | 550 | */ |
551 | 551 | static function fit_image_url( $src, $width, $height ) { |
@@ -129,6 +129,9 @@ |
||
129 | 129 | echo '<p>' . sprintf( _x( 'Learn more about the %s', 'the Internet Defense League', 'jetpack' ), '<a href="https://www.internetdefenseleague.org/">Internet Defense League</a>' ) . '</p>'; |
130 | 130 | } |
131 | 131 | |
132 | + /** |
|
133 | + * @param string $field_name |
|
134 | + */ |
|
132 | 135 | public function select( $field_name, $options, $default = null ) { |
133 | 136 | echo '<select class="widefat" name="' . $this->get_field_name( $field_name ) . '">'; |
134 | 137 | foreach ( $options as $option_slug => $option_name ) { |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | } |
935 | 935 | /** |
936 | 936 | * Does the network allow admins to add new users. |
937 | - * @return boolian |
|
937 | + * @return boolean |
|
938 | 938 | */ |
939 | 939 | static function network_add_new_users( $option = null ) { |
940 | 940 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | * database which could be set to anything as opposed to what this function returns. |
1040 | 1040 | * @param bool $option |
1041 | 1041 | * |
1042 | - * @return boolean |
|
1042 | + * @return string |
|
1043 | 1043 | */ |
1044 | 1044 | public function is_main_network_option( $option ) { |
1045 | 1045 | // return '1' or '' |
@@ -1050,7 +1050,7 @@ discard block |
||
1050 | 1050 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1051 | 1051 | * |
1052 | 1052 | * @param string $option |
1053 | - * @return boolean |
|
1053 | + * @return string |
|
1054 | 1054 | */ |
1055 | 1055 | public function is_multisite( $option ) { |
1056 | 1056 | return (string) (bool) is_multisite(); |
@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | |
1113 | 1113 | /** |
1114 | 1114 | * Returns true if the site has file write access false otherwise. |
1115 | - * @return string ( '1' | '0' ) |
|
1115 | + * @return integer ( '1' | '0' ) |
|
1116 | 1116 | **/ |
1117 | 1117 | public static function file_system_write_access() { |
1118 | 1118 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1351,6 +1351,7 @@ discard block |
||
1351 | 1351 | * @access public |
1352 | 1352 | * @static |
1353 | 1353 | * |
1354 | + * @param string $feature |
|
1354 | 1355 | * @return bool True if plan supports feature, false if not |
1355 | 1356 | */ |
1356 | 1357 | public static function active_plan_supports( $feature ) { |
@@ -1887,6 +1888,7 @@ discard block |
||
1887 | 1888 | * @param int $user_id |
1888 | 1889 | * @param string $token |
1889 | 1890 | * return bool |
1891 | + * @param boolean $is_master_user |
|
1890 | 1892 | */ |
1891 | 1893 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
1892 | 1894 | // not designed for concurrent updates |
@@ -2281,6 +2283,7 @@ discard block |
||
2281 | 2283 | |
2282 | 2284 | /** |
2283 | 2285 | * Like core's get_file_data implementation, but caches the result. |
2286 | + * @param string $file |
|
2284 | 2287 | */ |
2285 | 2288 | public static function get_file_data( $file, $headers ) { |
2286 | 2289 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2326,7 +2329,7 @@ discard block |
||
2326 | 2329 | * |
2327 | 2330 | * @param string $tag Tag as it appears in each module heading. |
2328 | 2331 | * |
2329 | - * @return mixed |
|
2332 | + * @return string |
|
2330 | 2333 | */ |
2331 | 2334 | public static function translate_module_tag( $tag ) { |
2332 | 2335 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2339,7 +2342,7 @@ discard block |
||
2339 | 2342 | * |
2340 | 2343 | * @param array $modules |
2341 | 2344 | * |
2342 | - * @return string|void |
|
2345 | + * @return string |
|
2343 | 2346 | */ |
2344 | 2347 | public static function get_translated_modules( $modules ) { |
2345 | 2348 | foreach ( $modules as $index => $module ) { |
@@ -2429,8 +2432,8 @@ discard block |
||
2429 | 2432 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2430 | 2433 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2431 | 2434 | * |
2432 | - * @param $string |
|
2433 | - * @return mixed |
|
2435 | + * @param string $string |
|
2436 | + * @return string|null |
|
2434 | 2437 | */ |
2435 | 2438 | public static function alias_directories( $string ) { |
2436 | 2439 | // ABSPATH has a trailing slash. |
@@ -2685,6 +2688,9 @@ discard block |
||
2685 | 2688 | return self::update_active_modules( $new ); |
2686 | 2689 | } |
2687 | 2690 | |
2691 | + /** |
|
2692 | + * @param string $module |
|
2693 | + */ |
|
2688 | 2694 | public static function enable_module_configurable( $module ) { |
2689 | 2695 | $module = Jetpack::get_module_slug( $module ); |
2690 | 2696 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2695,21 +2701,33 @@ discard block |
||
2695 | 2701 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2696 | 2702 | } |
2697 | 2703 | |
2704 | + /** |
|
2705 | + * @param string $module |
|
2706 | + */ |
|
2698 | 2707 | public static function module_configuration_load( $module, $method ) { |
2699 | 2708 | $module = Jetpack::get_module_slug( $module ); |
2700 | 2709 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2701 | 2710 | } |
2702 | 2711 | |
2712 | + /** |
|
2713 | + * @param string $module |
|
2714 | + */ |
|
2703 | 2715 | public static function module_configuration_head( $module, $method ) { |
2704 | 2716 | $module = Jetpack::get_module_slug( $module ); |
2705 | 2717 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2706 | 2718 | } |
2707 | 2719 | |
2720 | + /** |
|
2721 | + * @param string $module |
|
2722 | + */ |
|
2708 | 2723 | public static function module_configuration_screen( $module, $method ) { |
2709 | 2724 | $module = Jetpack::get_module_slug( $module ); |
2710 | 2725 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2711 | 2726 | } |
2712 | 2727 | |
2728 | + /** |
|
2729 | + * @param string $module |
|
2730 | + */ |
|
2713 | 2731 | public static function module_configuration_activation_screen( $module, $method ) { |
2714 | 2732 | $module = Jetpack::get_module_slug( $module ); |
2715 | 2733 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2717,6 +2735,9 @@ discard block |
||
2717 | 2735 | |
2718 | 2736 | /* Installation */ |
2719 | 2737 | |
2738 | + /** |
|
2739 | + * @param string $message |
|
2740 | + */ |
|
2720 | 2741 | public static function bail_on_activation( $message, $deactivate = true ) { |
2721 | 2742 | ?> |
2722 | 2743 | <!doctype html> |
@@ -3416,7 +3437,7 @@ discard block |
||
3416 | 3437 | * Add help to the Jetpack page |
3417 | 3438 | * |
3418 | 3439 | * @since Jetpack (1.2.3) |
3419 | - * @return false if not the Jetpack page |
|
3440 | + * @return false|null if not the Jetpack page |
|
3420 | 3441 | */ |
3421 | 3442 | function admin_help() { |
3422 | 3443 | $current_screen = get_current_screen(); |
@@ -4422,6 +4443,7 @@ discard block |
||
4422 | 4443 | /** |
4423 | 4444 | * Returns the requested Jetpack API URL |
4424 | 4445 | * |
4446 | + * @param string $relative_url |
|
4425 | 4447 | * @return string |
4426 | 4448 | */ |
4427 | 4449 | public static function api_url( $relative_url ) { |
@@ -4566,7 +4588,8 @@ discard block |
||
4566 | 4588 | * Note these tokens are unique per call, NOT static per site for connecting. |
4567 | 4589 | * |
4568 | 4590 | * @since 2.6 |
4569 | - * @return array |
|
4591 | + * @param string $action |
|
4592 | + * @return string|boolean |
|
4570 | 4593 | */ |
4571 | 4594 | public static function generate_secrets( $action, $exp = 600 ) { |
4572 | 4595 | $secret_name = 'jetpack_' . $action . '_' . get_current_user_id(); |
@@ -5005,7 +5028,6 @@ discard block |
||
5005 | 5028 | /** |
5006 | 5029 | * Report authentication status to the WP REST API. |
5007 | 5030 | * |
5008 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5009 | 5031 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5010 | 5032 | */ |
5011 | 5033 | public function wp_rest_authentication_errors( $value ) { |
@@ -5015,6 +5037,10 @@ discard block |
||
5015 | 5037 | return $this->rest_authentication_status; |
5016 | 5038 | } |
5017 | 5039 | |
5040 | + /** |
|
5041 | + * @param integer $timestamp |
|
5042 | + * @param string $nonce |
|
5043 | + */ |
|
5018 | 5044 | function add_nonce( $timestamp, $nonce ) { |
5019 | 5045 | global $wpdb; |
5020 | 5046 | static $nonces_used_this_request = array(); |
@@ -5160,6 +5186,7 @@ discard block |
||
5160 | 5186 | * @param string $key |
5161 | 5187 | * @param string $value |
5162 | 5188 | * @param bool $restate private |
5189 | + * @return string |
|
5163 | 5190 | */ |
5164 | 5191 | public static function state( $key = null, $value = null, $restate = false ) { |
5165 | 5192 | static $state = array(); |
@@ -5216,6 +5243,9 @@ discard block |
||
5216 | 5243 | Jetpack::state( null, null, true ); |
5217 | 5244 | } |
5218 | 5245 | |
5246 | + /** |
|
5247 | + * @param string $file |
|
5248 | + */ |
|
5219 | 5249 | public static function check_privacy( $file ) { |
5220 | 5250 | static $is_site_publicly_accessible = null; |
5221 | 5251 | |
@@ -5948,8 +5978,8 @@ discard block |
||
5948 | 5978 | * - Absolute URLs `http://domain.com/feh.png` |
5949 | 5979 | * - Domain root relative URLs `/feh.png` |
5950 | 5980 | * |
5951 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
5952 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
5981 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
5982 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
5953 | 5983 | * |
5954 | 5984 | * @return mixed|string |
5955 | 5985 | */ |
@@ -6240,7 +6270,7 @@ discard block |
||
6240 | 6270 | * |
6241 | 6271 | * @param string $option_name |
6242 | 6272 | * |
6243 | - * @return bool |
|
6273 | + * @return false|null |
|
6244 | 6274 | */ |
6245 | 6275 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6246 | 6276 | // Bail if Jump Start has already been dismissed |
@@ -6331,7 +6361,6 @@ discard block |
||
6331 | 6361 | } |
6332 | 6362 | |
6333 | 6363 | /** |
6334 | - * @param mixed $result Value for the user's option |
|
6335 | 6364 | * @return mixed |
6336 | 6365 | */ |
6337 | 6366 | function get_user_option_meta_box_order_dashboard( $sorted ) { |