@@ -24,6 +24,9 @@ |
||
| 24 | 24 | self::record_user_event( 'module_deactivated', array( 'module' => $module ) ); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | + /** |
|
| 28 | + * @param string $event_type |
|
| 29 | + */ |
|
| 27 | 30 | static function record_user_event( $event_type, $data ) { |
| 28 | 31 | |
| 29 | 32 | $user = wp_get_current_user(); |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | } |
| 1076 | 1076 | /** |
| 1077 | 1077 | * Does the network allow admins to add new users. |
| 1078 | - * @return boolian |
|
| 1078 | + * @return boolean |
|
| 1079 | 1079 | */ |
| 1080 | 1080 | static function network_add_new_users( $option = null ) { |
| 1081 | 1081 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | * database which could be set to anything as opposed to what this function returns. |
| 1124 | 1124 | * @param bool $option |
| 1125 | 1125 | * |
| 1126 | - * @return boolean |
|
| 1126 | + * @return string |
|
| 1127 | 1127 | */ |
| 1128 | 1128 | public function is_main_network_option( $option ) { |
| 1129 | 1129 | // return '1' or '' |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 1135 | 1135 | * |
| 1136 | 1136 | * @param string $option |
| 1137 | - * @return boolean |
|
| 1137 | + * @return string |
|
| 1138 | 1138 | */ |
| 1139 | 1139 | public function is_multisite( $option ) { |
| 1140 | 1140 | return (string) (bool) is_multisite(); |
@@ -1232,7 +1232,7 @@ discard block |
||
| 1232 | 1232 | |
| 1233 | 1233 | /** |
| 1234 | 1234 | * Returns true if the site has file write access false otherwise. |
| 1235 | - * @return string ( '1' | '0' ) |
|
| 1235 | + * @return integer ( '1' | '0' ) |
|
| 1236 | 1236 | **/ |
| 1237 | 1237 | public static function file_system_write_access() { |
| 1238 | 1238 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2028,7 +2028,7 @@ discard block |
||
| 2028 | 2028 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
| 2029 | 2029 | * |
| 2030 | 2030 | * @param string $name Option name |
| 2031 | - * @param mixed $default (optional) |
|
| 2031 | + * @param boolean $default (optional) |
|
| 2032 | 2032 | */ |
| 2033 | 2033 | public static function get_option( $name, $default = false ) { |
| 2034 | 2034 | return Jetpack_Options::get_option( $name, $default ); |
@@ -2038,6 +2038,7 @@ discard block |
||
| 2038 | 2038 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
| 2039 | 2039 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
| 2040 | 2040 | * $name must be a registered option name. |
| 2041 | + * @param string $name |
|
| 2041 | 2042 | */ |
| 2042 | 2043 | public static function create_nonce( $name ) { |
| 2043 | 2044 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -2095,6 +2096,7 @@ discard block |
||
| 2095 | 2096 | * @param int $user_id |
| 2096 | 2097 | * @param string $token |
| 2097 | 2098 | * return bool |
| 2099 | + * @param boolean $is_master_user |
|
| 2098 | 2100 | */ |
| 2099 | 2101 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 2100 | 2102 | // not designed for concurrent updates |
@@ -2489,6 +2491,7 @@ discard block |
||
| 2489 | 2491 | |
| 2490 | 2492 | /** |
| 2491 | 2493 | * Like core's get_file_data implementation, but caches the result. |
| 2494 | + * @param string $file |
|
| 2492 | 2495 | */ |
| 2493 | 2496 | public static function get_file_data( $file, $headers ) { |
| 2494 | 2497 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2512,6 +2515,9 @@ discard block |
||
| 2512 | 2515 | return $data; |
| 2513 | 2516 | } |
| 2514 | 2517 | |
| 2518 | + /** |
|
| 2519 | + * @param string $untranslated_tag |
|
| 2520 | + */ |
|
| 2515 | 2521 | public static function translate_module_tag( $untranslated_tag ) { |
| 2516 | 2522 | // Tags are aggregated by tools/build-module-headings-translations.php |
| 2517 | 2523 | // and output in modules/module-headings.php |
@@ -2804,6 +2810,9 @@ discard block |
||
| 2804 | 2810 | $this->sync->sync_all_module_options( $module ); |
| 2805 | 2811 | } |
| 2806 | 2812 | |
| 2813 | + /** |
|
| 2814 | + * @return string |
|
| 2815 | + */ |
|
| 2807 | 2816 | public static function deactivate_module( $module ) { |
| 2808 | 2817 | /** |
| 2809 | 2818 | * Fires when a module is deactivated. |
@@ -2842,6 +2851,9 @@ discard block |
||
| 2842 | 2851 | return Jetpack_Options::update_option( 'active_modules', array_unique( $new ) ); |
| 2843 | 2852 | } |
| 2844 | 2853 | |
| 2854 | + /** |
|
| 2855 | + * @param string $module |
|
| 2856 | + */ |
|
| 2845 | 2857 | public static function enable_module_configurable( $module ) { |
| 2846 | 2858 | $module = Jetpack::get_module_slug( $module ); |
| 2847 | 2859 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2852,21 +2864,33 @@ discard block |
||
| 2852 | 2864 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
| 2853 | 2865 | } |
| 2854 | 2866 | |
| 2867 | + /** |
|
| 2868 | + * @param string $module |
|
| 2869 | + */ |
|
| 2855 | 2870 | public static function module_configuration_load( $module, $method ) { |
| 2856 | 2871 | $module = Jetpack::get_module_slug( $module ); |
| 2857 | 2872 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
| 2858 | 2873 | } |
| 2859 | 2874 | |
| 2875 | + /** |
|
| 2876 | + * @param string $module |
|
| 2877 | + */ |
|
| 2860 | 2878 | public static function module_configuration_head( $module, $method ) { |
| 2861 | 2879 | $module = Jetpack::get_module_slug( $module ); |
| 2862 | 2880 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
| 2863 | 2881 | } |
| 2864 | 2882 | |
| 2883 | + /** |
|
| 2884 | + * @param string $module |
|
| 2885 | + */ |
|
| 2865 | 2886 | public static function module_configuration_screen( $module, $method ) { |
| 2866 | 2887 | $module = Jetpack::get_module_slug( $module ); |
| 2867 | 2888 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
| 2868 | 2889 | } |
| 2869 | 2890 | |
| 2891 | + /** |
|
| 2892 | + * @param string $module |
|
| 2893 | + */ |
|
| 2870 | 2894 | public static function module_configuration_activation_screen( $module, $method ) { |
| 2871 | 2895 | $module = Jetpack::get_module_slug( $module ); |
| 2872 | 2896 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2874,6 +2898,9 @@ discard block |
||
| 2874 | 2898 | |
| 2875 | 2899 | /* Installation */ |
| 2876 | 2900 | |
| 2901 | + /** |
|
| 2902 | + * @param string $message |
|
| 2903 | + */ |
|
| 2877 | 2904 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 2878 | 2905 | ?> |
| 2879 | 2906 | <!doctype html> |
@@ -3487,7 +3514,7 @@ discard block |
||
| 3487 | 3514 | * Add help to the Jetpack page |
| 3488 | 3515 | * |
| 3489 | 3516 | * @since Jetpack (1.2.3) |
| 3490 | - * @return false if not the Jetpack page |
|
| 3517 | + * @return false|null if not the Jetpack page |
|
| 3491 | 3518 | */ |
| 3492 | 3519 | function admin_help() { |
| 3493 | 3520 | $current_screen = get_current_screen(); |
@@ -4549,6 +4576,9 @@ discard block |
||
| 4549 | 4576 | return $url; |
| 4550 | 4577 | } |
| 4551 | 4578 | |
| 4579 | + /** |
|
| 4580 | + * @return string |
|
| 4581 | + */ |
|
| 4552 | 4582 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
| 4553 | 4583 | $actionurl = str_replace( '&', '&', $actionurl ); |
| 4554 | 4584 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -4779,6 +4809,7 @@ discard block |
||
| 4779 | 4809 | /** |
| 4780 | 4810 | * Returns the requested Jetpack API URL |
| 4781 | 4811 | * |
| 4812 | + * @param string $relative_url |
|
| 4782 | 4813 | * @return string |
| 4783 | 4814 | */ |
| 4784 | 4815 | public static function api_url( $relative_url ) { |
@@ -5203,6 +5234,10 @@ discard block |
||
| 5203 | 5234 | return new WP_User( $token_details['user_id'] ); |
| 5204 | 5235 | } |
| 5205 | 5236 | |
| 5237 | + /** |
|
| 5238 | + * @param integer $timestamp |
|
| 5239 | + * @param string $nonce |
|
| 5240 | + */ |
|
| 5206 | 5241 | function add_nonce( $timestamp, $nonce ) { |
| 5207 | 5242 | global $wpdb; |
| 5208 | 5243 | static $nonces_used_this_request = array(); |
@@ -5408,6 +5443,9 @@ discard block |
||
| 5408 | 5443 | Jetpack::state( null, null, true ); |
| 5409 | 5444 | } |
| 5410 | 5445 | |
| 5446 | + /** |
|
| 5447 | + * @param string $file |
|
| 5448 | + */ |
|
| 5411 | 5449 | public static function check_privacy( $file ) { |
| 5412 | 5450 | static $is_site_publicly_accessible = null; |
| 5413 | 5451 | |
@@ -6390,8 +6428,8 @@ discard block |
||
| 6390 | 6428 | * - Absolute URLs `http://domain.com/feh.png` |
| 6391 | 6429 | * - Domain root relative URLs `/feh.png` |
| 6392 | 6430 | * |
| 6393 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 6394 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6431 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 6432 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6395 | 6433 | * |
| 6396 | 6434 | * @return mixed|string |
| 6397 | 6435 | */ |
@@ -6789,7 +6827,6 @@ discard block |
||
| 6789 | 6827 | } |
| 6790 | 6828 | |
| 6791 | 6829 | /** |
| 6792 | - * @param mixed $result Value for the user's option |
|
| 6793 | 6830 | * @return mixed |
| 6794 | 6831 | */ |
| 6795 | 6832 | function get_user_option_meta_box_order_dashboard( $sorted ) { |