@@ -147,6 +147,7 @@ discard block |
||
147 | 147 | * Performs a remote XML-RPC query using Jetpack's IXR Client. And also |
148 | 148 | * appends some useful stuff about this setup to the query. |
149 | 149 | * |
150 | + * @param string $method |
|
150 | 151 | * @return the Jetpack_IXR_Client object after querying. |
151 | 152 | */ |
152 | 153 | function query( $method, $args = null ) { |
@@ -349,6 +350,7 @@ discard block |
||
349 | 350 | * |
350 | 351 | * Similar to current_user_can, but internal to VideoPress. Returns |
351 | 352 | * true if the given VideoPress capability is allowed by the given user. |
353 | + * @param string $cap |
|
352 | 354 | */ |
353 | 355 | function can( $cap, $user_id = false ) { |
354 | 356 | if ( ! $user_id ) |
@@ -252,6 +252,9 @@ |
||
252 | 252 | return ( FALSE !== strpos( $url, 'facebook.com' ) ) ? TRUE : FALSE; |
253 | 253 | } |
254 | 254 | |
255 | + /** |
|
256 | + * @param integer $value |
|
257 | + */ |
|
255 | 258 | function normalize_int_value( $value, $default = 0, $max = 0, $min = 0 ) { |
256 | 259 | $value = (int) $value; |
257 | 260 |
@@ -89,6 +89,9 @@ |
||
89 | 89 | do_action( 'jetpack_stats_extra', 'widget', 'goodreads' ); |
90 | 90 | } |
91 | 91 | |
92 | + /** |
|
93 | + * @param string $user_id |
|
94 | + */ |
|
92 | 95 | function goodreads_user_id_exists( $user_id ) { |
93 | 96 | $url = "http://www.goodreads.com/user/show/$user_id/"; |
94 | 97 | $response = wp_remote_head( $url, array( 'httpversion'=>'1.1', 'timeout'=>3, 'redirection'=> 2 ) ); |
@@ -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 | $new = $this->api->ends_with( $path, '/new' ); |
33 | 38 | $args = $this->query_args(); |
@@ -621,6 +626,11 @@ discard block |
||
621 | 626 | } |
622 | 627 | |
623 | 628 | // /sites/%s/posts/%d/delete -> $blog_id, $post_id |
629 | + |
|
630 | + /** |
|
631 | + * @param string $path |
|
632 | + * @param integer $post_id |
|
633 | + */ |
|
624 | 634 | function delete_post( $path, $blog_id, $post_id ) { |
625 | 635 | $post = get_post( $post_id ); |
626 | 636 | if ( !$post || is_wp_error( $post ) ) { |
@@ -656,6 +666,11 @@ discard block |
||
656 | 666 | } |
657 | 667 | |
658 | 668 | // /sites/%s/posts/%d/restore -> $blog_id, $post_id |
669 | + |
|
670 | + /** |
|
671 | + * @param string $path |
|
672 | + * @param integer $post_id |
|
673 | + */ |
|
659 | 674 | function restore_post( $path, $blog_id, $post_id ) { |
660 | 675 | $args = $this->query_args(); |
661 | 676 | $post = get_post( $post_id ); |
@@ -676,6 +691,10 @@ discard block |
||
676 | 691 | return $this->get_post_by( 'ID', $post->ID, $args['context'] ); |
677 | 692 | } |
678 | 693 | |
694 | + /** |
|
695 | + * @param boolean $delete_featured_image |
|
696 | + * @param string $featured_image |
|
697 | + */ |
|
679 | 698 | protected function parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image ) { |
680 | 699 | if ( $delete_featured_image ) { |
681 | 700 | delete_post_thumbnail( $post_id ); |
@@ -616,6 +616,9 @@ |
||
616 | 616 | return strcasecmp( $a->name, $b->name ); |
617 | 617 | } |
618 | 618 | |
619 | + /** |
|
620 | + * @return string |
|
621 | + */ |
|
619 | 622 | public static function maybe_get_split_term( $old_term_id = '', $taxonomy = '' ) { |
620 | 623 | $term_id = $old_term_id; |
621 | 624 |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | * Our [portfolio] shortcode. |
394 | 394 | * Prints Portfolio data styled to look good on *any* theme. |
395 | 395 | * |
396 | - * @return portfolio_shortcode_html |
|
396 | + * @return string |
|
397 | 397 | */ |
398 | 398 | static function portfolio_shortcode( $atts ) { |
399 | 399 | // Default attributes |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | * The Portfolio shortcode loop. |
527 | 527 | * |
528 | 528 | * @todo add theme color styles |
529 | - * @return html |
|
529 | + * @return string |
|
530 | 530 | */ |
531 | 531 | static function portfolio_shortcode_html( $atts ) { |
532 | 532 | |
@@ -618,6 +618,7 @@ discard block |
||
618 | 618 | /** |
619 | 619 | * Individual project class |
620 | 620 | * |
621 | + * @param integer $portfolio_index_number |
|
621 | 622 | * @return string |
622 | 623 | */ |
623 | 624 | static function get_project_class( $portfolio_index_number, $columns ) { |
@@ -725,7 +726,7 @@ discard block |
||
725 | 726 | /** |
726 | 727 | * Displays the author of the current portfolio project. |
727 | 728 | * |
728 | - * @return html |
|
729 | + * @return string |
|
729 | 730 | */ |
730 | 731 | static function get_project_author() { |
731 | 732 | $html = '<div class="project-author"><span>' . esc_html__( 'Author:', 'jetpack' ) . '</span> '; |
@@ -738,7 +739,7 @@ discard block |
||
738 | 739 | /** |
739 | 740 | * Display the featured image if it's available |
740 | 741 | * |
741 | - * @return html |
|
742 | + * @return string|null |
|
742 | 743 | */ |
743 | 744 | static function get_portfolio_thumbnail_link( $post_id ) { |
744 | 745 | if ( has_post_thumbnail( $post_id ) ) { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | /** |
50 | 50 | * record_event |
51 | - * @param mixed $event Event object to send to Tracks. An array will be cast to object. Required. |
|
51 | + * @param Jetpack_Tracks_Event $event Event object to send to Tracks. An array will be cast to object. Required. |
|
52 | 52 | * Properties are included directly in the pixel query string after light validation. |
53 | 53 | * @return mixed True on success, WP_Error on failure |
54 | 54 | */ |
@@ -71,6 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | /** |
73 | 73 | * Synchronously request the pixel |
74 | + * @param string $pixel |
|
74 | 75 | */ |
75 | 76 | static function record_pixel( $pixel ) { |
76 | 77 | // Add the Request Timestamp and URL terminator just before the HTTP request. |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @param string $event_name The name of the event |
38 | 38 | * @param array $properties Custom properties to send with the event |
39 | 39 | * @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred |
40 | - * @return \Jetpack_Tracks_Event|\WP_Error |
|
40 | + * @return Jetpack_Tracks_Event |
|
41 | 41 | */ |
42 | 42 | function jetpack_tracks_build_event_obj( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) { |
43 | 43 | |
@@ -107,7 +107,6 @@ discard block |
||
107 | 107 | /** |
108 | 108 | * Record an event in Tracks - this is the preferred way to record events from PHP. |
109 | 109 | * |
110 | - * @param mixed $identity username, user_id, or WP_user object |
|
111 | 110 | * @param string $event_name The name of the event |
112 | 111 | * @param array $properties Custom properties to send with the event |
113 | 112 | * @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | } |
1100 | 1100 | /** |
1101 | 1101 | * Does the network allow admins to add new users. |
1102 | - * @return boolian |
|
1102 | + * @return boolean |
|
1103 | 1103 | */ |
1104 | 1104 | static function network_add_new_users( $option = null ) { |
1105 | 1105 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | * database which could be set to anything as opposed to what this function returns. |
1148 | 1148 | * @param bool $option |
1149 | 1149 | * |
1150 | - * @return boolean |
|
1150 | + * @return string |
|
1151 | 1151 | */ |
1152 | 1152 | public function is_main_network_option( $option ) { |
1153 | 1153 | // return '1' or '' |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1159 | 1159 | * |
1160 | 1160 | * @param string $option |
1161 | - * @return boolean |
|
1161 | + * @return string |
|
1162 | 1162 | */ |
1163 | 1163 | public function is_multisite( $option ) { |
1164 | 1164 | return (string) (bool) is_multisite(); |
@@ -1256,7 +1256,7 @@ discard block |
||
1256 | 1256 | |
1257 | 1257 | /** |
1258 | 1258 | * Returns true if the site has file write access false otherwise. |
1259 | - * @return string ( '1' | '0' ) |
|
1259 | + * @return integer ( '1' | '0' ) |
|
1260 | 1260 | **/ |
1261 | 1261 | public static function file_system_write_access() { |
1262 | 1262 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2053,7 +2053,7 @@ discard block |
||
2053 | 2053 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
2054 | 2054 | * |
2055 | 2055 | * @param string $name Option name |
2056 | - * @param mixed $default (optional) |
|
2056 | + * @param boolean $default (optional) |
|
2057 | 2057 | */ |
2058 | 2058 | public static function get_option( $name, $default = false ) { |
2059 | 2059 | return Jetpack_Options::get_option( $name, $default ); |
@@ -2063,6 +2063,7 @@ discard block |
||
2063 | 2063 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
2064 | 2064 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
2065 | 2065 | * $name must be a registered option name. |
2066 | + * @param string $name |
|
2066 | 2067 | */ |
2067 | 2068 | public static function create_nonce( $name ) { |
2068 | 2069 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -2120,6 +2121,7 @@ discard block |
||
2120 | 2121 | * @param int $user_id |
2121 | 2122 | * @param string $token |
2122 | 2123 | * return bool |
2124 | + * @param boolean $is_master_user |
|
2123 | 2125 | */ |
2124 | 2126 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2125 | 2127 | // not designed for concurrent updates |
@@ -2514,6 +2516,7 @@ discard block |
||
2514 | 2516 | |
2515 | 2517 | /** |
2516 | 2518 | * Like core's get_file_data implementation, but caches the result. |
2519 | + * @param string $file |
|
2517 | 2520 | */ |
2518 | 2521 | public static function get_file_data( $file, $headers ) { |
2519 | 2522 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2542,7 +2545,7 @@ discard block |
||
2542 | 2545 | * |
2543 | 2546 | * @param string $tag Tag as it appears in each module heading. |
2544 | 2547 | * |
2545 | - * @return mixed |
|
2548 | + * @return string |
|
2546 | 2549 | */ |
2547 | 2550 | public static function translate_module_tag( $tag ) { |
2548 | 2551 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2857,6 +2860,9 @@ discard block |
||
2857 | 2860 | $this->sync->sync_all_module_options( $module ); |
2858 | 2861 | } |
2859 | 2862 | |
2863 | + /** |
|
2864 | + * @return string |
|
2865 | + */ |
|
2860 | 2866 | public static function deactivate_module( $module ) { |
2861 | 2867 | /** |
2862 | 2868 | * Fires when a module is deactivated. |
@@ -2895,6 +2901,9 @@ discard block |
||
2895 | 2901 | return Jetpack_Options::update_option( 'active_modules', array_unique( $new ) ); |
2896 | 2902 | } |
2897 | 2903 | |
2904 | + /** |
|
2905 | + * @param string $module |
|
2906 | + */ |
|
2898 | 2907 | public static function enable_module_configurable( $module ) { |
2899 | 2908 | $module = Jetpack::get_module_slug( $module ); |
2900 | 2909 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2905,21 +2914,33 @@ discard block |
||
2905 | 2914 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2906 | 2915 | } |
2907 | 2916 | |
2917 | + /** |
|
2918 | + * @param string $module |
|
2919 | + */ |
|
2908 | 2920 | public static function module_configuration_load( $module, $method ) { |
2909 | 2921 | $module = Jetpack::get_module_slug( $module ); |
2910 | 2922 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2911 | 2923 | } |
2912 | 2924 | |
2925 | + /** |
|
2926 | + * @param string $module |
|
2927 | + */ |
|
2913 | 2928 | public static function module_configuration_head( $module, $method ) { |
2914 | 2929 | $module = Jetpack::get_module_slug( $module ); |
2915 | 2930 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2916 | 2931 | } |
2917 | 2932 | |
2933 | + /** |
|
2934 | + * @param string $module |
|
2935 | + */ |
|
2918 | 2936 | public static function module_configuration_screen( $module, $method ) { |
2919 | 2937 | $module = Jetpack::get_module_slug( $module ); |
2920 | 2938 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2921 | 2939 | } |
2922 | 2940 | |
2941 | + /** |
|
2942 | + * @param string $module |
|
2943 | + */ |
|
2923 | 2944 | public static function module_configuration_activation_screen( $module, $method ) { |
2924 | 2945 | $module = Jetpack::get_module_slug( $module ); |
2925 | 2946 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2927,6 +2948,9 @@ discard block |
||
2927 | 2948 | |
2928 | 2949 | /* Installation */ |
2929 | 2950 | |
2951 | + /** |
|
2952 | + * @param string $message |
|
2953 | + */ |
|
2930 | 2954 | public static function bail_on_activation( $message, $deactivate = true ) { |
2931 | 2955 | ?> |
2932 | 2956 | <!doctype html> |
@@ -3540,7 +3564,7 @@ discard block |
||
3540 | 3564 | * Add help to the Jetpack page |
3541 | 3565 | * |
3542 | 3566 | * @since Jetpack (1.2.3) |
3543 | - * @return false if not the Jetpack page |
|
3567 | + * @return false|null if not the Jetpack page |
|
3544 | 3568 | */ |
3545 | 3569 | function admin_help() { |
3546 | 3570 | $current_screen = get_current_screen(); |
@@ -4830,6 +4854,7 @@ discard block |
||
4830 | 4854 | /** |
4831 | 4855 | * Returns the requested Jetpack API URL |
4832 | 4856 | * |
4857 | + * @param string $relative_url |
|
4833 | 4858 | * @return string |
4834 | 4859 | */ |
4835 | 4860 | public static function api_url( $relative_url ) { |
@@ -5254,6 +5279,10 @@ discard block |
||
5254 | 5279 | return new WP_User( $token_details['user_id'] ); |
5255 | 5280 | } |
5256 | 5281 | |
5282 | + /** |
|
5283 | + * @param integer $timestamp |
|
5284 | + * @param string $nonce |
|
5285 | + */ |
|
5257 | 5286 | function add_nonce( $timestamp, $nonce ) { |
5258 | 5287 | global $wpdb; |
5259 | 5288 | static $nonces_used_this_request = array(); |
@@ -5459,6 +5488,9 @@ discard block |
||
5459 | 5488 | Jetpack::state( null, null, true ); |
5460 | 5489 | } |
5461 | 5490 | |
5491 | + /** |
|
5492 | + * @param string $file |
|
5493 | + */ |
|
5462 | 5494 | public static function check_privacy( $file ) { |
5463 | 5495 | static $is_site_publicly_accessible = null; |
5464 | 5496 | |
@@ -6488,8 +6520,8 @@ discard block |
||
6488 | 6520 | * - Absolute URLs `http://domain.com/feh.png` |
6489 | 6521 | * - Domain root relative URLs `/feh.png` |
6490 | 6522 | * |
6491 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6492 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6523 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6524 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6493 | 6525 | * |
6494 | 6526 | * @return mixed|string |
6495 | 6527 | */ |
@@ -6885,7 +6917,6 @@ discard block |
||
6885 | 6917 | } |
6886 | 6918 | |
6887 | 6919 | /** |
6888 | - * @param mixed $result Value for the user's option |
|
6889 | 6920 | * @return mixed |
6890 | 6921 | */ |
6891 | 6922 | function get_user_option_meta_box_order_dashboard( $sorted ) { |