@@ -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 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | /** |
| 116 | 116 | * Iterates through expected items ( plugins or themes ) and compares them to actual results. |
| 117 | 117 | * |
| 118 | - * @param $items 'plugin' or 'theme' |
|
| 118 | + * @param string $items 'plugin' or 'theme' |
|
| 119 | 119 | */ |
| 120 | 120 | function log_items( $items ) { |
| 121 | 121 | $num_items_updated = 0; |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | * @param $item Example: 'jetpack/jetpack.php' for type 'plugin' or 'twentyfifteen' for type 'theme' |
| 195 | 195 | * @param string $type 'plugin' or 'theme' |
| 196 | 196 | * |
| 197 | - * @return bool|string |
|
| 197 | + * @return false|string |
|
| 198 | 198 | */ |
| 199 | 199 | private function get_error_message( $item, $type = 'plugin' ) { |
| 200 | 200 | if ( ! isset( $this->autoupdate_results[ $type ] ) ) { |
@@ -64,7 +64,6 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * @param string $file __FILE__ |
| 67 | - * @param string $option, Option name to sync |
|
| 68 | 67 | * @param string $option ... |
| 69 | 68 | */ |
| 70 | 69 | static function sync_options( $file, $option /*, $option, ... */ ) { |
@@ -75,8 +74,6 @@ discard block |
||
| 75 | 74 | } |
| 76 | 75 | /** |
| 77 | 76 | * @param string $file __FILE__ |
| 78 | - * @param string $option, Option name to sync |
|
| 79 | - * @param string $option ... |
|
| 80 | 77 | */ |
| 81 | 78 | static function sync_constant( $file, $constant ) { |
| 82 | 79 | if ( is_network_admin() ) return; |
@@ -352,6 +349,9 @@ discard block |
||
| 352 | 349 | $this->transition_post_status_action( 'delete', $post->post_status, $post ); |
| 353 | 350 | } |
| 354 | 351 | |
| 352 | + /** |
|
| 353 | + * @param string $new_status |
|
| 354 | + */ |
|
| 355 | 355 | function transition_post_status_action( $new_status, $old_status, $post ) { |
| 356 | 356 | $sync = $this->get_post_sync_operation( $new_status, $old_status, $post, $this->sync_conditions['posts'] ); |
| 357 | 357 | if ( !$sync ) { |
@@ -736,6 +736,11 @@ discard block |
||
| 736 | 736 | /* Options Sync */ |
| 737 | 737 | |
| 738 | 738 | /* Ah... so much simpler than Posts and Comments :) */ |
| 739 | + |
|
| 740 | + /** |
|
| 741 | + * @param string $file |
|
| 742 | + * @param string $option |
|
| 743 | + */ |
|
| 739 | 744 | function options( $file, $option /*, $option, ... */ ) { |
| 740 | 745 | $options = func_get_args(); |
| 741 | 746 | $file = array_shift( $options ); |
@@ -42,6 +42,9 @@ discard block |
||
| 42 | 42 | return $numbers; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + /** |
|
| 46 | + * @param integer $number |
|
| 47 | + */ |
|
| 45 | 48 | public function index_for_number( $number ) { |
| 46 | 49 | if ( !isset( $this->_index_for_number ) ) { |
| 47 | 50 | $gettext = new Gettext_Translations; |
@@ -2014,6 +2017,9 @@ discard block |
||
| 2014 | 2017 | return isset( $instance->locales[ $slug ] )? $instance->locales[ $slug ] : null; |
| 2015 | 2018 | } |
| 2016 | 2019 | |
| 2020 | + /** |
|
| 2021 | + * @param string $field_name |
|
| 2022 | + */ |
|
| 2017 | 2023 | public static function by_field( $field_name, $field_value ) { |
| 2018 | 2024 | $instance = GP_Locales::instance(); |
| 2019 | 2025 | $result = false; |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | } |
| 1050 | 1050 | /** |
| 1051 | 1051 | * Does the network allow admins to add new users. |
| 1052 | - * @return boolian |
|
| 1052 | + * @return boolean |
|
| 1053 | 1053 | */ |
| 1054 | 1054 | static function network_add_new_users( $option = null ) { |
| 1055 | 1055 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1097,7 +1097,7 @@ discard block |
||
| 1097 | 1097 | * database which could be set to anything as opposed to what this function returns. |
| 1098 | 1098 | * @param bool $option |
| 1099 | 1099 | * |
| 1100 | - * @return boolean |
|
| 1100 | + * @return string |
|
| 1101 | 1101 | */ |
| 1102 | 1102 | public function is_main_network_option( $option ) { |
| 1103 | 1103 | // return '1' or '' |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 1109 | 1109 | * |
| 1110 | 1110 | * @param string $option |
| 1111 | - * @return boolean |
|
| 1111 | + * @return string |
|
| 1112 | 1112 | */ |
| 1113 | 1113 | public function is_multisite( $option ) { |
| 1114 | 1114 | return (string) (bool) is_multisite(); |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | |
| 1207 | 1207 | /** |
| 1208 | 1208 | * Returns true if the site has file write access false otherwise. |
| 1209 | - * @return string ( '1' | '0' ) |
|
| 1209 | + * @return integer ( '1' | '0' ) |
|
| 1210 | 1210 | **/ |
| 1211 | 1211 | public static function file_system_write_access() { |
| 1212 | 1212 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1913,7 +1913,7 @@ discard block |
||
| 1913 | 1913 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
| 1914 | 1914 | * |
| 1915 | 1915 | * @param string $name Option name |
| 1916 | - * @param mixed $default (optional) |
|
| 1916 | + * @param boolean $default (optional) |
|
| 1917 | 1917 | */ |
| 1918 | 1918 | public static function get_option( $name, $default = false ) { |
| 1919 | 1919 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1923,6 +1923,7 @@ discard block |
||
| 1923 | 1923 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
| 1924 | 1924 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
| 1925 | 1925 | * $name must be a registered option name. |
| 1926 | + * @param string $name |
|
| 1926 | 1927 | */ |
| 1927 | 1928 | public static function create_nonce( $name ) { |
| 1928 | 1929 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -1980,6 +1981,7 @@ discard block |
||
| 1980 | 1981 | * @param int $user_id |
| 1981 | 1982 | * @param string $token |
| 1982 | 1983 | * return bool |
| 1984 | + * @param boolean $is_master_user |
|
| 1983 | 1985 | */ |
| 1984 | 1986 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 1985 | 1987 | // not designed for concurrent updates |
@@ -2376,6 +2378,7 @@ discard block |
||
| 2376 | 2378 | |
| 2377 | 2379 | /** |
| 2378 | 2380 | * Like core's get_file_data implementation, but caches the result. |
| 2381 | + * @param string $file |
|
| 2379 | 2382 | */ |
| 2380 | 2383 | public static function get_file_data( $file, $headers ) { |
| 2381 | 2384 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2399,6 +2402,9 @@ discard block |
||
| 2399 | 2402 | return $data; |
| 2400 | 2403 | } |
| 2401 | 2404 | |
| 2405 | + /** |
|
| 2406 | + * @param string $untranslated_tag |
|
| 2407 | + */ |
|
| 2402 | 2408 | public static function translate_module_tag( $untranslated_tag ) { |
| 2403 | 2409 | // Tags are aggregated by tools/build-module-headings-translations.php |
| 2404 | 2410 | // and output in modules/module-headings.php |
@@ -2691,6 +2697,9 @@ discard block |
||
| 2691 | 2697 | $this->sync->sync_all_module_options( $module ); |
| 2692 | 2698 | } |
| 2693 | 2699 | |
| 2700 | + /** |
|
| 2701 | + * @return string |
|
| 2702 | + */ |
|
| 2694 | 2703 | public static function deactivate_module( $module ) { |
| 2695 | 2704 | /** |
| 2696 | 2705 | * Fires when a module is deactivated. |
@@ -2729,6 +2738,9 @@ discard block |
||
| 2729 | 2738 | return Jetpack_Options::update_option( 'active_modules', array_unique( $new ) ); |
| 2730 | 2739 | } |
| 2731 | 2740 | |
| 2741 | + /** |
|
| 2742 | + * @param string $module |
|
| 2743 | + */ |
|
| 2732 | 2744 | public static function enable_module_configurable( $module ) { |
| 2733 | 2745 | $module = Jetpack::get_module_slug( $module ); |
| 2734 | 2746 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2739,16 +2751,25 @@ discard block |
||
| 2739 | 2751 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
| 2740 | 2752 | } |
| 2741 | 2753 | |
| 2754 | + /** |
|
| 2755 | + * @param string $module |
|
| 2756 | + */ |
|
| 2742 | 2757 | public static function module_configuration_load( $module, $method ) { |
| 2743 | 2758 | $module = Jetpack::get_module_slug( $module ); |
| 2744 | 2759 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
| 2745 | 2760 | } |
| 2746 | 2761 | |
| 2762 | + /** |
|
| 2763 | + * @param string $module |
|
| 2764 | + */ |
|
| 2747 | 2765 | public static function module_configuration_head( $module, $method ) { |
| 2748 | 2766 | $module = Jetpack::get_module_slug( $module ); |
| 2749 | 2767 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
| 2750 | 2768 | } |
| 2751 | 2769 | |
| 2770 | + /** |
|
| 2771 | + * @param string $module |
|
| 2772 | + */ |
|
| 2752 | 2773 | public static function module_configuration_screen( $module, $method ) { |
| 2753 | 2774 | $module = Jetpack::get_module_slug( $module ); |
| 2754 | 2775 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
@@ -2756,6 +2777,9 @@ discard block |
||
| 2756 | 2777 | |
| 2757 | 2778 | /* Installation */ |
| 2758 | 2779 | |
| 2780 | + /** |
|
| 2781 | + * @param string $message |
|
| 2782 | + */ |
|
| 2759 | 2783 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 2760 | 2784 | ?> |
| 2761 | 2785 | <!doctype html> |
@@ -3339,7 +3363,7 @@ discard block |
||
| 3339 | 3363 | * Add help to the Jetpack page |
| 3340 | 3364 | * |
| 3341 | 3365 | * @since Jetpack (1.2.3) |
| 3342 | - * @return false if not the Jetpack page |
|
| 3366 | + * @return false|null if not the Jetpack page |
|
| 3343 | 3367 | */ |
| 3344 | 3368 | function admin_help() { |
| 3345 | 3369 | $current_screen = get_current_screen(); |
@@ -4612,6 +4636,7 @@ discard block |
||
| 4612 | 4636 | /** |
| 4613 | 4637 | * Returns the requested Jetpack API URL |
| 4614 | 4638 | * |
| 4639 | + * @param string $relative_url |
|
| 4615 | 4640 | * @return string |
| 4616 | 4641 | */ |
| 4617 | 4642 | public static function api_url( $relative_url ) { |
@@ -5028,6 +5053,10 @@ discard block |
||
| 5028 | 5053 | return new WP_User( $token_details['user_id'] ); |
| 5029 | 5054 | } |
| 5030 | 5055 | |
| 5056 | + /** |
|
| 5057 | + * @param integer $timestamp |
|
| 5058 | + * @param string $nonce |
|
| 5059 | + */ |
|
| 5031 | 5060 | function add_nonce( $timestamp, $nonce ) { |
| 5032 | 5061 | global $wpdb; |
| 5033 | 5062 | static $nonces_used_this_request = array(); |
@@ -5233,6 +5262,9 @@ discard block |
||
| 5233 | 5262 | Jetpack::state( null, null, true ); |
| 5234 | 5263 | } |
| 5235 | 5264 | |
| 5265 | + /** |
|
| 5266 | + * @param string $file |
|
| 5267 | + */ |
|
| 5236 | 5268 | public static function check_privacy( $file ) { |
| 5237 | 5269 | static $is_site_publicly_accessible = null; |
| 5238 | 5270 | |
@@ -6203,8 +6235,8 @@ discard block |
||
| 6203 | 6235 | * - Absolute URLs `http://domain.com/feh.png` |
| 6204 | 6236 | * - Domain root relative URLs `/feh.png` |
| 6205 | 6237 | * |
| 6206 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 6207 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6238 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 6239 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6208 | 6240 | * |
| 6209 | 6241 | * @return mixed|string |
| 6210 | 6242 | */ |
@@ -6602,7 +6634,6 @@ discard block |
||
| 6602 | 6634 | } |
| 6603 | 6635 | |
| 6604 | 6636 | /** |
| 6605 | - * @param mixed $result Value for the user's option |
|
| 6606 | 6637 | * @return mixed |
| 6607 | 6638 | */ |
| 6608 | 6639 | function get_user_option_meta_box_order_dashboard( $sorted ) { |