@@ -646,7 +646,7 @@ |
||
646 | 646 | * handlers should be copied when the theme context is loaded by the REST API. |
647 | 647 | * |
648 | 648 | * @param array $copy_dirs Copy paths with actions to be copied |
649 | - * @return array Copy paths with featured content plugin |
|
649 | + * @return string[] Copy paths with featured content plugin |
|
650 | 650 | */ |
651 | 651 | function wpcom_rest_api_featured_content_copy_plugin_actions( $copy_dirs ) { |
652 | 652 | $copy_dirs[] = __FILE__; |
@@ -28,6 +28,11 @@ discard block |
||
28 | 28 | |
29 | 29 | // /sites/%s/posts/new -> $blog_id |
30 | 30 | // /sites/%s/posts/%d -> $blog_id, $post_id |
31 | + |
|
32 | + /** |
|
33 | + * @param string $path |
|
34 | + * @param integer $post_id |
|
35 | + */ |
|
31 | 36 | function write_post( $path, $blog_id, $post_id ) { |
32 | 37 | global $wpdb; |
33 | 38 | |
@@ -704,6 +709,11 @@ discard block |
||
704 | 709 | } |
705 | 710 | |
706 | 711 | // /sites/%s/posts/%d/delete -> $blog_id, $post_id |
712 | + |
|
713 | + /** |
|
714 | + * @param string $path |
|
715 | + * @param integer $post_id |
|
716 | + */ |
|
707 | 717 | function delete_post( $path, $blog_id, $post_id ) { |
708 | 718 | $post = get_post( $post_id ); |
709 | 719 | if ( !$post || is_wp_error( $post ) ) { |
@@ -743,6 +753,11 @@ discard block |
||
743 | 753 | } |
744 | 754 | |
745 | 755 | // /sites/%s/posts/%d/restore -> $blog_id, $post_id |
756 | + |
|
757 | + /** |
|
758 | + * @param string $path |
|
759 | + * @param integer $post_id |
|
760 | + */ |
|
746 | 761 | function restore_post( $path, $blog_id, $post_id ) { |
747 | 762 | $args = $this->query_args(); |
748 | 763 | $post = get_post( $post_id ); |
@@ -763,6 +778,10 @@ discard block |
||
763 | 778 | return $this->get_post_by( 'ID', $post->ID, $args['context'] ); |
764 | 779 | } |
765 | 780 | |
781 | + /** |
|
782 | + * @param boolean $delete_featured_image |
|
783 | + * @param string $featured_image |
|
784 | + */ |
|
766 | 785 | protected function parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image ) { |
767 | 786 | if ( $delete_featured_image ) { |
768 | 787 | delete_post_thumbnail( $post_id ); |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | } |
952 | 952 | /** |
953 | 953 | * Does the network allow admins to add new users. |
954 | - * @return boolian |
|
954 | + * @return boolean |
|
955 | 955 | */ |
956 | 956 | static function network_add_new_users( $option = null ) { |
957 | 957 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | * database which could be set to anything as opposed to what this function returns. |
1057 | 1057 | * @param bool $option |
1058 | 1058 | * |
1059 | - * @return boolean |
|
1059 | + * @return string |
|
1060 | 1060 | */ |
1061 | 1061 | public function is_main_network_option( $option ) { |
1062 | 1062 | // return '1' or '' |
@@ -1067,7 +1067,7 @@ discard block |
||
1067 | 1067 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1068 | 1068 | * |
1069 | 1069 | * @param string $option |
1070 | - * @return boolean |
|
1070 | + * @return string |
|
1071 | 1071 | */ |
1072 | 1072 | public function is_multisite( $option ) { |
1073 | 1073 | return (string) (bool) is_multisite(); |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | |
1130 | 1130 | /** |
1131 | 1131 | * Returns true if the site has file write access false otherwise. |
1132 | - * @return string ( '1' | '0' ) |
|
1132 | + * @return integer ( '1' | '0' ) |
|
1133 | 1133 | **/ |
1134 | 1134 | public static function file_system_write_access() { |
1135 | 1135 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1368,6 +1368,7 @@ discard block |
||
1368 | 1368 | * @access public |
1369 | 1369 | * @static |
1370 | 1370 | * |
1371 | + * @param string $feature |
|
1371 | 1372 | * @return bool True if plan supports feature, false if not |
1372 | 1373 | */ |
1373 | 1374 | public static function active_plan_supports( $feature ) { |
@@ -1857,7 +1858,7 @@ discard block |
||
1857 | 1858 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
1858 | 1859 | * |
1859 | 1860 | * @param string $name Option name |
1860 | - * @param mixed $default (optional) |
|
1861 | + * @param integer $default (optional) |
|
1861 | 1862 | */ |
1862 | 1863 | public static function get_option( $name, $default = false ) { |
1863 | 1864 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1904,6 +1905,7 @@ discard block |
||
1904 | 1905 | * @param int $user_id |
1905 | 1906 | * @param string $token |
1906 | 1907 | * return bool |
1908 | + * @param boolean $is_master_user |
|
1907 | 1909 | */ |
1908 | 1910 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
1909 | 1911 | // not designed for concurrent updates |
@@ -2298,6 +2300,7 @@ discard block |
||
2298 | 2300 | |
2299 | 2301 | /** |
2300 | 2302 | * Like core's get_file_data implementation, but caches the result. |
2303 | + * @param string $file |
|
2301 | 2304 | */ |
2302 | 2305 | public static function get_file_data( $file, $headers ) { |
2303 | 2306 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2343,7 +2346,7 @@ discard block |
||
2343 | 2346 | * |
2344 | 2347 | * @param string $tag Tag as it appears in each module heading. |
2345 | 2348 | * |
2346 | - * @return mixed |
|
2349 | + * @return string |
|
2347 | 2350 | */ |
2348 | 2351 | public static function translate_module_tag( $tag ) { |
2349 | 2352 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2356,7 +2359,7 @@ discard block |
||
2356 | 2359 | * |
2357 | 2360 | * @param array $modules |
2358 | 2361 | * |
2359 | - * @return string|void |
|
2362 | + * @return string |
|
2360 | 2363 | */ |
2361 | 2364 | public static function get_translated_modules( $modules ) { |
2362 | 2365 | foreach ( $modules as $index => $module ) { |
@@ -2446,8 +2449,8 @@ discard block |
||
2446 | 2449 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2447 | 2450 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2448 | 2451 | * |
2449 | - * @param $string |
|
2450 | - * @return mixed |
|
2452 | + * @param string $string |
|
2453 | + * @return string|null |
|
2451 | 2454 | */ |
2452 | 2455 | public static function alias_directories( $string ) { |
2453 | 2456 | // ABSPATH has a trailing slash. |
@@ -2702,6 +2705,9 @@ discard block |
||
2702 | 2705 | return self::update_active_modules( $new ); |
2703 | 2706 | } |
2704 | 2707 | |
2708 | + /** |
|
2709 | + * @param string $module |
|
2710 | + */ |
|
2705 | 2711 | public static function enable_module_configurable( $module ) { |
2706 | 2712 | $module = Jetpack::get_module_slug( $module ); |
2707 | 2713 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2712,21 +2718,33 @@ discard block |
||
2712 | 2718 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2713 | 2719 | } |
2714 | 2720 | |
2721 | + /** |
|
2722 | + * @param string $module |
|
2723 | + */ |
|
2715 | 2724 | public static function module_configuration_load( $module, $method ) { |
2716 | 2725 | $module = Jetpack::get_module_slug( $module ); |
2717 | 2726 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2718 | 2727 | } |
2719 | 2728 | |
2729 | + /** |
|
2730 | + * @param string $module |
|
2731 | + */ |
|
2720 | 2732 | public static function module_configuration_head( $module, $method ) { |
2721 | 2733 | $module = Jetpack::get_module_slug( $module ); |
2722 | 2734 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2723 | 2735 | } |
2724 | 2736 | |
2737 | + /** |
|
2738 | + * @param string $module |
|
2739 | + */ |
|
2725 | 2740 | public static function module_configuration_screen( $module, $method ) { |
2726 | 2741 | $module = Jetpack::get_module_slug( $module ); |
2727 | 2742 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2728 | 2743 | } |
2729 | 2744 | |
2745 | + /** |
|
2746 | + * @param string $module |
|
2747 | + */ |
|
2730 | 2748 | public static function module_configuration_activation_screen( $module, $method ) { |
2731 | 2749 | $module = Jetpack::get_module_slug( $module ); |
2732 | 2750 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2734,6 +2752,9 @@ discard block |
||
2734 | 2752 | |
2735 | 2753 | /* Installation */ |
2736 | 2754 | |
2755 | + /** |
|
2756 | + * @param string $message |
|
2757 | + */ |
|
2737 | 2758 | public static function bail_on_activation( $message, $deactivate = true ) { |
2738 | 2759 | ?> |
2739 | 2760 | <!doctype html> |
@@ -3433,7 +3454,7 @@ discard block |
||
3433 | 3454 | * Add help to the Jetpack page |
3434 | 3455 | * |
3435 | 3456 | * @since Jetpack (1.2.3) |
3436 | - * @return false if not the Jetpack page |
|
3457 | + * @return false|null if not the Jetpack page |
|
3437 | 3458 | */ |
3438 | 3459 | function admin_help() { |
3439 | 3460 | $current_screen = get_current_screen(); |
@@ -4448,6 +4469,7 @@ discard block |
||
4448 | 4469 | /** |
4449 | 4470 | * Returns the requested Jetpack API URL |
4450 | 4471 | * |
4472 | + * @param string $relative_url |
|
4451 | 4473 | * @return string |
4452 | 4474 | */ |
4453 | 4475 | public static function api_url( $relative_url ) { |
@@ -4592,7 +4614,8 @@ discard block |
||
4592 | 4614 | * Note these tokens are unique per call, NOT static per site for connecting. |
4593 | 4615 | * |
4594 | 4616 | * @since 2.6 |
4595 | - * @return array |
|
4617 | + * @param string $action |
|
4618 | + * @return boolean |
|
4596 | 4619 | */ |
4597 | 4620 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
4598 | 4621 | if ( ! $user_id ) { |
@@ -5071,7 +5094,6 @@ discard block |
||
5071 | 5094 | /** |
5072 | 5095 | * Report authentication status to the WP REST API. |
5073 | 5096 | * |
5074 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5075 | 5097 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5076 | 5098 | */ |
5077 | 5099 | public function wp_rest_authentication_errors( $value ) { |
@@ -5081,6 +5103,10 @@ discard block |
||
5081 | 5103 | return $this->rest_authentication_status; |
5082 | 5104 | } |
5083 | 5105 | |
5106 | + /** |
|
5107 | + * @param integer $timestamp |
|
5108 | + * @param string $nonce |
|
5109 | + */ |
|
5084 | 5110 | function add_nonce( $timestamp, $nonce ) { |
5085 | 5111 | global $wpdb; |
5086 | 5112 | static $nonces_used_this_request = array(); |
@@ -5226,6 +5252,7 @@ discard block |
||
5226 | 5252 | * @param string $key |
5227 | 5253 | * @param string $value |
5228 | 5254 | * @param bool $restate private |
5255 | + * @return string |
|
5229 | 5256 | */ |
5230 | 5257 | public static function state( $key = null, $value = null, $restate = false ) { |
5231 | 5258 | static $state = array(); |
@@ -5282,6 +5309,9 @@ discard block |
||
5282 | 5309 | Jetpack::state( null, null, true ); |
5283 | 5310 | } |
5284 | 5311 | |
5312 | + /** |
|
5313 | + * @param string $file |
|
5314 | + */ |
|
5285 | 5315 | public static function check_privacy( $file ) { |
5286 | 5316 | static $is_site_publicly_accessible = null; |
5287 | 5317 | |
@@ -6015,8 +6045,8 @@ discard block |
||
6015 | 6045 | * - Absolute URLs `http://domain.com/feh.png` |
6016 | 6046 | * - Domain root relative URLs `/feh.png` |
6017 | 6047 | * |
6018 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6019 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6048 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6049 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6020 | 6050 | * |
6021 | 6051 | * @return mixed|string |
6022 | 6052 | */ |
@@ -6307,7 +6337,7 @@ discard block |
||
6307 | 6337 | * |
6308 | 6338 | * @param string $option_name |
6309 | 6339 | * |
6310 | - * @return bool |
|
6340 | + * @return false|null |
|
6311 | 6341 | */ |
6312 | 6342 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6313 | 6343 | // Bail if Jump Start has already been dismissed |
@@ -6398,7 +6428,6 @@ discard block |
||
6398 | 6428 | } |
6399 | 6429 | |
6400 | 6430 | /** |
6401 | - * @param mixed $result Value for the user's option |
|
6402 | 6431 | * @return mixed |
6403 | 6432 | */ |
6404 | 6433 | function get_user_option_meta_box_order_dashboard( $sorted ) { |