@@ -67,6 +67,7 @@ |
||
| 67 | 67 | * |
| 68 | 68 | * Similar to current_user_can, but internal to VideoPress. Returns |
| 69 | 69 | * true if the given VideoPress capability is allowed by the given user. |
| 70 | + * @param string $cap |
|
| 70 | 71 | */ |
| 71 | 72 | public function can( $cap, $user_id = false ) { |
| 72 | 73 | if ( ! $user_id ) { |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @param string $type The type of option to return. Defaults to 'compact'. |
| 18 | 18 | * |
| 19 | - * @return array |
|
| 19 | + * @return string[] |
|
| 20 | 20 | */ |
| 21 | 21 | public static function get_option_names( $type = 'compact' ) { |
| 22 | 22 | switch ( $type ) { |
@@ -163,6 +163,9 @@ discard block |
||
| 163 | 163 | return $value; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | + /** |
|
| 167 | + * @param string $name |
|
| 168 | + */ |
|
| 166 | 169 | private static function update_grouped_option( $group, $name, $value ) { |
| 167 | 170 | $options = get_option( self::$grouped_options[ $group ] ); |
| 168 | 171 | if ( ! is_array( $options ) ) { |
@@ -257,6 +260,9 @@ discard block |
||
| 257 | 260 | return $result; |
| 258 | 261 | } |
| 259 | 262 | |
| 263 | + /** |
|
| 264 | + * @param string $name |
|
| 265 | + */ |
|
| 260 | 266 | private static function get_grouped_option( $group, $name, $default ) { |
| 261 | 267 | $options = get_option( self::$grouped_options[ $group ] ); |
| 262 | 268 | if ( is_array( $options ) && isset( $options[ $name ] ) ) { |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | } |
| 883 | 883 | /** |
| 884 | 884 | * Does the network allow admins to add new users. |
| 885 | - * @return boolian |
|
| 885 | + * @return boolean |
|
| 886 | 886 | */ |
| 887 | 887 | static function network_add_new_users( $option = null ) { |
| 888 | 888 | return (bool) get_site_option( 'add_new_users' ); |
@@ -987,7 +987,7 @@ discard block |
||
| 987 | 987 | * database which could be set to anything as opposed to what this function returns. |
| 988 | 988 | * @param bool $option |
| 989 | 989 | * |
| 990 | - * @return boolean |
|
| 990 | + * @return string |
|
| 991 | 991 | */ |
| 992 | 992 | public function is_main_network_option( $option ) { |
| 993 | 993 | // return '1' or '' |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 999 | 999 | * |
| 1000 | 1000 | * @param string $option |
| 1001 | - * @return boolean |
|
| 1001 | + * @return string |
|
| 1002 | 1002 | */ |
| 1003 | 1003 | public function is_multisite( $option ) { |
| 1004 | 1004 | return (string) (bool) is_multisite(); |
@@ -1056,7 +1056,7 @@ discard block |
||
| 1056 | 1056 | |
| 1057 | 1057 | /** |
| 1058 | 1058 | * Returns true if the site has file write access false otherwise. |
| 1059 | - * @return string ( '1' | '0' ) |
|
| 1059 | + * @return integer ( '1' | '0' ) |
|
| 1060 | 1060 | **/ |
| 1061 | 1061 | public static function file_system_write_access() { |
| 1062 | 1062 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1630,7 +1630,7 @@ discard block |
||
| 1630 | 1630 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
| 1631 | 1631 | * |
| 1632 | 1632 | * @param string $name Option name |
| 1633 | - * @param mixed $default (optional) |
|
| 1633 | + * @param boolean $default (optional) |
|
| 1634 | 1634 | */ |
| 1635 | 1635 | public static function get_option( $name, $default = false ) { |
| 1636 | 1636 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1640,6 +1640,7 @@ discard block |
||
| 1640 | 1640 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
| 1641 | 1641 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
| 1642 | 1642 | * $name must be a registered option name. |
| 1643 | + * @param string $name |
|
| 1643 | 1644 | */ |
| 1644 | 1645 | public static function create_nonce( $name ) { |
| 1645 | 1646 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -1697,6 +1698,7 @@ discard block |
||
| 1697 | 1698 | * @param int $user_id |
| 1698 | 1699 | * @param string $token |
| 1699 | 1700 | * return bool |
| 1701 | + * @param boolean $is_master_user |
|
| 1700 | 1702 | */ |
| 1701 | 1703 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 1702 | 1704 | // not designed for concurrent updates |
@@ -2091,6 +2093,7 @@ discard block |
||
| 2091 | 2093 | |
| 2092 | 2094 | /** |
| 2093 | 2095 | * Like core's get_file_data implementation, but caches the result. |
| 2096 | + * @param string $file |
|
| 2094 | 2097 | */ |
| 2095 | 2098 | public static function get_file_data( $file, $headers ) { |
| 2096 | 2099 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2119,7 +2122,7 @@ discard block |
||
| 2119 | 2122 | * |
| 2120 | 2123 | * @param string $tag Tag as it appears in each module heading. |
| 2121 | 2124 | * |
| 2122 | - * @return mixed |
|
| 2125 | + * @return string |
|
| 2123 | 2126 | */ |
| 2124 | 2127 | public static function translate_module_tag( $tag ) { |
| 2125 | 2128 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2132,7 +2135,7 @@ discard block |
||
| 2132 | 2135 | * |
| 2133 | 2136 | * @param array $modules |
| 2134 | 2137 | * |
| 2135 | - * @return string|void |
|
| 2138 | + * @return string |
|
| 2136 | 2139 | */ |
| 2137 | 2140 | public static function get_translated_modules( $modules ) { |
| 2138 | 2141 | foreach ( $modules as $index => $module ) { |
@@ -2448,6 +2451,9 @@ discard block |
||
| 2448 | 2451 | return self::update_active_modules( $new ); |
| 2449 | 2452 | } |
| 2450 | 2453 | |
| 2454 | + /** |
|
| 2455 | + * @param string $module |
|
| 2456 | + */ |
|
| 2451 | 2457 | public static function enable_module_configurable( $module ) { |
| 2452 | 2458 | $module = Jetpack::get_module_slug( $module ); |
| 2453 | 2459 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2458,21 +2464,33 @@ discard block |
||
| 2458 | 2464 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
| 2459 | 2465 | } |
| 2460 | 2466 | |
| 2467 | + /** |
|
| 2468 | + * @param string $module |
|
| 2469 | + */ |
|
| 2461 | 2470 | public static function module_configuration_load( $module, $method ) { |
| 2462 | 2471 | $module = Jetpack::get_module_slug( $module ); |
| 2463 | 2472 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
| 2464 | 2473 | } |
| 2465 | 2474 | |
| 2475 | + /** |
|
| 2476 | + * @param string $module |
|
| 2477 | + */ |
|
| 2466 | 2478 | public static function module_configuration_head( $module, $method ) { |
| 2467 | 2479 | $module = Jetpack::get_module_slug( $module ); |
| 2468 | 2480 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
| 2469 | 2481 | } |
| 2470 | 2482 | |
| 2483 | + /** |
|
| 2484 | + * @param string $module |
|
| 2485 | + */ |
|
| 2471 | 2486 | public static function module_configuration_screen( $module, $method ) { |
| 2472 | 2487 | $module = Jetpack::get_module_slug( $module ); |
| 2473 | 2488 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
| 2474 | 2489 | } |
| 2475 | 2490 | |
| 2491 | + /** |
|
| 2492 | + * @param string $module |
|
| 2493 | + */ |
|
| 2476 | 2494 | public static function module_configuration_activation_screen( $module, $method ) { |
| 2477 | 2495 | $module = Jetpack::get_module_slug( $module ); |
| 2478 | 2496 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2480,6 +2498,9 @@ discard block |
||
| 2480 | 2498 | |
| 2481 | 2499 | /* Installation */ |
| 2482 | 2500 | |
| 2501 | + /** |
|
| 2502 | + * @param string $message |
|
| 2503 | + */ |
|
| 2483 | 2504 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 2484 | 2505 | ?> |
| 2485 | 2506 | <!doctype html> |
@@ -3109,7 +3130,7 @@ discard block |
||
| 3109 | 3130 | * Add help to the Jetpack page |
| 3110 | 3131 | * |
| 3111 | 3132 | * @since Jetpack (1.2.3) |
| 3112 | - * @return false if not the Jetpack page |
|
| 3133 | + * @return false|null if not the Jetpack page |
|
| 3113 | 3134 | */ |
| 3114 | 3135 | function admin_help() { |
| 3115 | 3136 | $current_screen = get_current_screen(); |
@@ -4107,6 +4128,7 @@ discard block |
||
| 4107 | 4128 | /** |
| 4108 | 4129 | * Returns the requested Jetpack API URL |
| 4109 | 4130 | * |
| 4131 | + * @param string $relative_url |
|
| 4110 | 4132 | * @return string |
| 4111 | 4133 | */ |
| 4112 | 4134 | public static function api_url( $relative_url ) { |
@@ -4251,7 +4273,8 @@ discard block |
||
| 4251 | 4273 | * Note these tokens are unique per call, NOT static per site for connecting. |
| 4252 | 4274 | * |
| 4253 | 4275 | * @since 2.6 |
| 4254 | - * @return array |
|
| 4276 | + * @param string $action |
|
| 4277 | + * @return string |
|
| 4255 | 4278 | */ |
| 4256 | 4279 | public function generate_secrets( $action, $exp = 600 ) { |
| 4257 | 4280 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -4577,6 +4600,10 @@ discard block |
||
| 4577 | 4600 | return new WP_User( $token_details['user_id'] ); |
| 4578 | 4601 | } |
| 4579 | 4602 | |
| 4603 | + /** |
|
| 4604 | + * @param integer $timestamp |
|
| 4605 | + * @param string $nonce |
|
| 4606 | + */ |
|
| 4580 | 4607 | function add_nonce( $timestamp, $nonce ) { |
| 4581 | 4608 | global $wpdb; |
| 4582 | 4609 | static $nonces_used_this_request = array(); |
@@ -4722,6 +4749,7 @@ discard block |
||
| 4722 | 4749 | * @param string $key |
| 4723 | 4750 | * @param string $value |
| 4724 | 4751 | * @param bool $restate private |
| 4752 | + * @return string |
|
| 4725 | 4753 | */ |
| 4726 | 4754 | public static function state( $key = null, $value = null, $restate = false ) { |
| 4727 | 4755 | static $state = array(); |
@@ -4778,6 +4806,9 @@ discard block |
||
| 4778 | 4806 | Jetpack::state( null, null, true ); |
| 4779 | 4807 | } |
| 4780 | 4808 | |
| 4809 | + /** |
|
| 4810 | + * @param string $file |
|
| 4811 | + */ |
|
| 4781 | 4812 | public static function check_privacy( $file ) { |
| 4782 | 4813 | static $is_site_publicly_accessible = null; |
| 4783 | 4814 | |
@@ -5521,8 +5552,8 @@ discard block |
||
| 5521 | 5552 | * - Absolute URLs `http://domain.com/feh.png` |
| 5522 | 5553 | * - Domain root relative URLs `/feh.png` |
| 5523 | 5554 | * |
| 5524 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 5525 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5555 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 5556 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5526 | 5557 | * |
| 5527 | 5558 | * @return mixed|string |
| 5528 | 5559 | */ |
@@ -5813,7 +5844,7 @@ discard block |
||
| 5813 | 5844 | * |
| 5814 | 5845 | * @param string $option_name |
| 5815 | 5846 | * |
| 5816 | - * @return bool |
|
| 5847 | + * @return false|null |
|
| 5817 | 5848 | */ |
| 5818 | 5849 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
| 5819 | 5850 | // Bail if Jump Start has already been dismissed |
@@ -5904,7 +5935,6 @@ discard block |
||
| 5904 | 5935 | } |
| 5905 | 5936 | |
| 5906 | 5937 | /** |
| 5907 | - * @param mixed $result Value for the user's option |
|
| 5908 | 5938 | * @return mixed |
| 5909 | 5939 | */ |
| 5910 | 5940 | function get_user_option_meta_box_order_dashboard( $sorted ) { |