@@ -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 ); |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | * database which could be set to anything as opposed to what this function returns. |
| 882 | 882 | * @param bool $option |
| 883 | 883 | * |
| 884 | - * @return boolean |
|
| 884 | + * @return string |
|
| 885 | 885 | */ |
| 886 | 886 | public function is_main_network_option( $option ) { |
| 887 | 887 | // return '1' or '' |
@@ -892,7 +892,7 @@ discard block |
||
| 892 | 892 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 893 | 893 | * |
| 894 | 894 | * @param string $option |
| 895 | - * @return boolean |
|
| 895 | + * @return string |
|
| 896 | 896 | */ |
| 897 | 897 | public function is_multisite( $option ) { |
| 898 | 898 | return (string) (bool) is_multisite(); |
@@ -1452,7 +1452,7 @@ discard block |
||
| 1452 | 1452 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
| 1453 | 1453 | * |
| 1454 | 1454 | * @param string $name Option name |
| 1455 | - * @param mixed $default (optional) |
|
| 1455 | + * @param boolean $default (optional) |
|
| 1456 | 1456 | */ |
| 1457 | 1457 | public static function get_option( $name, $default = false ) { |
| 1458 | 1458 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1462,6 +1462,7 @@ discard block |
||
| 1462 | 1462 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
| 1463 | 1463 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
| 1464 | 1464 | * $name must be a registered option name. |
| 1465 | + * @param string $name |
|
| 1465 | 1466 | */ |
| 1466 | 1467 | public static function create_nonce( $name ) { |
| 1467 | 1468 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -1519,6 +1520,7 @@ discard block |
||
| 1519 | 1520 | * @param int $user_id |
| 1520 | 1521 | * @param string $token |
| 1521 | 1522 | * return bool |
| 1523 | + * @param boolean $is_master_user |
|
| 1522 | 1524 | */ |
| 1523 | 1525 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 1524 | 1526 | // not designed for concurrent updates |
@@ -1895,6 +1897,7 @@ discard block |
||
| 1895 | 1897 | |
| 1896 | 1898 | /** |
| 1897 | 1899 | * Like core's get_file_data implementation, but caches the result. |
| 1900 | + * @param string $file |
|
| 1898 | 1901 | */ |
| 1899 | 1902 | public static function get_file_data( $file, $headers ) { |
| 1900 | 1903 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -1918,6 +1921,9 @@ discard block |
||
| 1918 | 1921 | return $data; |
| 1919 | 1922 | } |
| 1920 | 1923 | |
| 1924 | + /** |
|
| 1925 | + * @param string $untranslated_tag |
|
| 1926 | + */ |
|
| 1921 | 1927 | public static function translate_module_tag( $untranslated_tag ) { |
| 1922 | 1928 | // Tags are aggregated by tools/build-module-headings-translations.php |
| 1923 | 1929 | // and output in modules/module-headings.php |
@@ -2167,6 +2173,9 @@ discard block |
||
| 2167 | 2173 | $this->sync->sync_all_module_options( $module ); |
| 2168 | 2174 | } |
| 2169 | 2175 | |
| 2176 | + /** |
|
| 2177 | + * @return string |
|
| 2178 | + */ |
|
| 2170 | 2179 | public static function deactivate_module( $module ) { |
| 2171 | 2180 | do_action( 'jetpack_pre_deactivate_module', $module ); |
| 2172 | 2181 | |
@@ -2190,6 +2199,9 @@ discard block |
||
| 2190 | 2199 | return Jetpack_Options::update_option( 'active_modules', array_unique( $new ) ); |
| 2191 | 2200 | } |
| 2192 | 2201 | |
| 2202 | + /** |
|
| 2203 | + * @param string $module |
|
| 2204 | + */ |
|
| 2193 | 2205 | public static function enable_module_configurable( $module ) { |
| 2194 | 2206 | $module = Jetpack::get_module_slug( $module ); |
| 2195 | 2207 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2200,16 +2212,25 @@ discard block |
||
| 2200 | 2212 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
| 2201 | 2213 | } |
| 2202 | 2214 | |
| 2215 | + /** |
|
| 2216 | + * @param string $module |
|
| 2217 | + */ |
|
| 2203 | 2218 | public static function module_configuration_load( $module, $method ) { |
| 2204 | 2219 | $module = Jetpack::get_module_slug( $module ); |
| 2205 | 2220 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
| 2206 | 2221 | } |
| 2207 | 2222 | |
| 2223 | + /** |
|
| 2224 | + * @param string $module |
|
| 2225 | + */ |
|
| 2208 | 2226 | public static function module_configuration_head( $module, $method ) { |
| 2209 | 2227 | $module = Jetpack::get_module_slug( $module ); |
| 2210 | 2228 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
| 2211 | 2229 | } |
| 2212 | 2230 | |
| 2231 | + /** |
|
| 2232 | + * @param string $module |
|
| 2233 | + */ |
|
| 2213 | 2234 | public static function module_configuration_screen( $module, $method ) { |
| 2214 | 2235 | $module = Jetpack::get_module_slug( $module ); |
| 2215 | 2236 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
@@ -2217,6 +2238,9 @@ discard block |
||
| 2217 | 2238 | |
| 2218 | 2239 | /* Installation */ |
| 2219 | 2240 | |
| 2241 | + /** |
|
| 2242 | + * @param string $message |
|
| 2243 | + */ |
|
| 2220 | 2244 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 2221 | 2245 | ?> |
| 2222 | 2246 | <!doctype html> |
@@ -2782,7 +2806,7 @@ discard block |
||
| 2782 | 2806 | * Add help to the Jetpack page |
| 2783 | 2807 | * |
| 2784 | 2808 | * @since Jetpack (1.2.3) |
| 2785 | - * @return false if not the Jetpack page |
|
| 2809 | + * @return false|null if not the Jetpack page |
|
| 2786 | 2810 | */ |
| 2787 | 2811 | function admin_help() { |
| 2788 | 2812 | $current_screen = get_current_screen(); |
@@ -4008,6 +4032,7 @@ discard block |
||
| 4008 | 4032 | /** |
| 4009 | 4033 | * Returns the requested Jetpack API URL |
| 4010 | 4034 | * |
| 4035 | + * @param string $relative_url |
|
| 4011 | 4036 | * @return string |
| 4012 | 4037 | */ |
| 4013 | 4038 | public static function api_url( $relative_url ) { |
@@ -4422,6 +4447,10 @@ discard block |
||
| 4422 | 4447 | return new WP_User( $token_details['user_id'] ); |
| 4423 | 4448 | } |
| 4424 | 4449 | |
| 4450 | + /** |
|
| 4451 | + * @param integer $timestamp |
|
| 4452 | + * @param string $nonce |
|
| 4453 | + */ |
|
| 4425 | 4454 | function add_nonce( $timestamp, $nonce ) { |
| 4426 | 4455 | global $wpdb; |
| 4427 | 4456 | static $nonces_used_this_request = array(); |
@@ -4627,6 +4656,9 @@ discard block |
||
| 4627 | 4656 | Jetpack::state( null, null, true ); |
| 4628 | 4657 | } |
| 4629 | 4658 | |
| 4659 | + /** |
|
| 4660 | + * @param string $file |
|
| 4661 | + */ |
|
| 4630 | 4662 | public static function check_privacy( $file ) { |
| 4631 | 4663 | static $is_site_publicly_accessible = null; |
| 4632 | 4664 | |
@@ -5272,8 +5304,8 @@ discard block |
||
| 5272 | 5304 | * - Absolute URLs `http://domain.com/feh.png` |
| 5273 | 5305 | * - Domain root relative URLs `/feh.png` |
| 5274 | 5306 | * |
| 5275 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 5276 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5307 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 5308 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5277 | 5309 | * |
| 5278 | 5310 | * @return mixed|string |
| 5279 | 5311 | */ |
@@ -5661,7 +5693,6 @@ discard block |
||
| 5661 | 5693 | } |
| 5662 | 5694 | |
| 5663 | 5695 | /** |
| 5664 | - * @param mixed $result Value for the user's option |
|
| 5665 | 5696 | * @return mixed |
| 5666 | 5697 | */ |
| 5667 | 5698 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -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(); |
@@ -578,6 +583,11 @@ discard block |
||
| 578 | 583 | } |
| 579 | 584 | |
| 580 | 585 | // /sites/%s/posts/%d/delete -> $blog_id, $post_id |
| 586 | + |
|
| 587 | + /** |
|
| 588 | + * @param string $path |
|
| 589 | + * @param integer $post_id |
|
| 590 | + */ |
|
| 581 | 591 | function delete_post( $path, $blog_id, $post_id ) { |
| 582 | 592 | $post = get_post( $post_id ); |
| 583 | 593 | if ( !$post || is_wp_error( $post ) ) { |
@@ -612,6 +622,11 @@ discard block |
||
| 612 | 622 | } |
| 613 | 623 | |
| 614 | 624 | // /sites/%s/posts/%d/restore -> $blog_id, $post_id |
| 625 | + |
|
| 626 | + /** |
|
| 627 | + * @param string $path |
|
| 628 | + * @param integer $post_id |
|
| 629 | + */ |
|
| 615 | 630 | function restore_post( $path, $blog_id, $post_id ) { |
| 616 | 631 | $args = $this->query_args(); |
| 617 | 632 | $post = get_post( $post_id ); |
@@ -631,6 +646,9 @@ discard block |
||
| 631 | 646 | return $this->get_post_by( 'ID', $post->ID, $args['context'] ); |
| 632 | 647 | } |
| 633 | 648 | |
| 649 | + /** |
|
| 650 | + * @param boolean $delete_featured_image |
|
| 651 | + */ |
|
| 634 | 652 | private function parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image ) { |
| 635 | 653 | if ( $delete_featured_image ) { |
| 636 | 654 | delete_post_thumbnail( $post_id ); |
@@ -56,6 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Switches to the blog and checks current user capabilities. |
| 59 | + * @param integer $_blog_id |
|
| 59 | 60 | * @return bool|WP_Error a WP_Error object or true if things are good. |
| 60 | 61 | */ |
| 61 | 62 | protected function validate_call( $_blog_id, $capability, $check_manage_active = true ) { |
@@ -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; |
@@ -1004,7 +1004,6 @@ discard block |
||
| 1004 | 1004 | * Turn on printing of grunion.css stylesheet |
| 1005 | 1005 | * @see ::style() |
| 1006 | 1006 | * @internal |
| 1007 | - * @param bool $style |
|
| 1008 | 1007 | */ |
| 1009 | 1008 | static function _style_on() { |
| 1010 | 1009 | return self::style( true ); |
@@ -1116,6 +1115,9 @@ discard block |
||
| 1116 | 1115 | return $r; |
| 1117 | 1116 | } |
| 1118 | 1117 | |
| 1118 | + /** |
|
| 1119 | + * @param Grunion_Contact_Form $form |
|
| 1120 | + */ |
|
| 1119 | 1121 | static function success_message( $feedback_id, $form ) { |
| 1120 | 1122 | $r_success_message = ''; |
| 1121 | 1123 | |
@@ -1192,7 +1194,7 @@ discard block |
||
| 1192 | 1194 | * |
| 1193 | 1195 | * @param array $attributes Key => Value pairs as parsed by shortcode_parse_atts() |
| 1194 | 1196 | * @param string|null $content The shortcode's inner content: [contact-field]$content[/contact-field] |
| 1195 | - * @return HTML for the contact form field |
|
| 1197 | + * @return string for the contact form field |
|
| 1196 | 1198 | */ |
| 1197 | 1199 | static function parse_contact_field( $attributes, $content ) { |
| 1198 | 1200 | // Don't try to parse contact form fields if not inside a contact form |
@@ -172,6 +172,9 @@ discard block |
||
| 172 | 172 | do_action( 'sharing_bump_stats', array( 'service' => $this, 'post' => $post ) ); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | + /** |
|
| 176 | + * @param string $name |
|
| 177 | + */ |
|
| 175 | 178 | public function js_dialog( $name, $params = array() ) { |
| 176 | 179 | if ( true !== $this->open_link_in_new ) |
| 177 | 180 | return; |
@@ -1122,6 +1125,9 @@ discard block |
||
| 1122 | 1125 | return __( 'Pinterest', 'jetpack' ); |
| 1123 | 1126 | } |
| 1124 | 1127 | |
| 1128 | + /** |
|
| 1129 | + * @return string |
|
| 1130 | + */ |
|
| 1125 | 1131 | public function get_image( $post ) { |
| 1126 | 1132 | if ( class_exists( 'Jetpack_PostImages' ) ) { |
| 1127 | 1133 | $image = Jetpack_PostImages::get_image( $post->ID, array( 'fallback_to_avatars' => true ) ); |