@@ -119,8 +119,8 @@ |
||
119 | 119 | /** |
120 | 120 | * Determines whether tracking should be enabled. |
121 | 121 | * |
122 | - * @param Automattic\Jetpack\Terms_Of_Service $terms_of_service A Terms_Of_Service object. |
|
123 | - * @param Automattic\Jetpack\Status $status A Status object. |
|
122 | + * @param Terms_Of_Service $terms_of_service A Terms_Of_Service object. |
|
123 | + * @param Status $status A Status object. |
|
124 | 124 | * |
125 | 125 | * @return boolean True if tracking should be enabled, else false. |
126 | 126 | */ |
@@ -352,6 +352,9 @@ discard block |
||
352 | 352 | return Grunion_Contact_Form::parse( $atts, do_blocks( $content ) ); |
353 | 353 | } |
354 | 354 | |
355 | + /** |
|
356 | + * @param string $type |
|
357 | + */ |
|
355 | 358 | public static function block_attributes_to_shortcode_attributes( $atts, $type ) { |
356 | 359 | $atts['type'] = $type; |
357 | 360 | if ( isset( $atts['className'] ) ) { |
@@ -403,6 +406,10 @@ discard block |
||
403 | 406 | $atts = self::block_attributes_to_shortcode_attributes( $atts, 'checkbox-multiple' ); |
404 | 407 | return Grunion_Contact_Form::parse_contact_field( $atts, $content ); |
405 | 408 | } |
409 | + |
|
410 | + /** |
|
411 | + * @param string $content |
|
412 | + */ |
|
406 | 413 | public static function gutenblock_render_field_radio( $atts, $content ) { |
407 | 414 | $atts = self::block_attributes_to_shortcode_attributes( $atts, 'radio' ); |
408 | 415 | return Grunion_Contact_Form::parse_contact_field( $atts, $content ); |
@@ -2045,7 +2052,6 @@ discard block |
||
2045 | 2052 | * |
2046 | 2053 | * @see ::style() |
2047 | 2054 | * @internal |
2048 | - * @param bool $style |
|
2049 | 2055 | */ |
2050 | 2056 | static function _style_on() { |
2051 | 2057 | return self::style( true ); |
@@ -2236,6 +2242,7 @@ discard block |
||
2236 | 2242 | * |
2237 | 2243 | * @param int $feedback_id |
2238 | 2244 | * @param object Grunion_Contact_Form $form |
2245 | + * @param Grunion_Contact_Form $form |
|
2239 | 2246 | * |
2240 | 2247 | * @return string $message |
2241 | 2248 | */ |
@@ -2394,7 +2401,7 @@ discard block |
||
2394 | 2401 | * |
2395 | 2402 | * @param array $attributes Key => Value pairs as parsed by shortcode_parse_atts() |
2396 | 2403 | * @param string|null $content The shortcode's inner content: [contact-field]$content[/contact-field] |
2397 | - * @return HTML for the contact form field |
|
2404 | + * @return string for the contact form field |
|
2398 | 2405 | */ |
2399 | 2406 | static function parse_contact_field( $attributes, $content ) { |
2400 | 2407 | // Don't try to parse contact form fields if not inside a contact form |
@@ -3523,6 +3530,9 @@ discard block |
||
3523 | 3530 | |
3524 | 3531 | } |
3525 | 3532 | |
3533 | + /** |
|
3534 | + * @param string $type |
|
3535 | + */ |
|
3526 | 3536 | function render_input_field( $type, $id, $value, $class, $placeholder, $required ) { |
3527 | 3537 | return "<input |
3528 | 3538 | type='". esc_attr( $type ) ."' |
@@ -3534,24 +3544,40 @@ discard block |
||
3534 | 3544 | />\n"; |
3535 | 3545 | } |
3536 | 3546 | |
3547 | + /** |
|
3548 | + * @param string $class |
|
3549 | + * @param string $placeholder |
|
3550 | + */ |
|
3537 | 3551 | function render_email_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3538 | 3552 | $field = $this->render_label( 'email', $id, $label, $required, $required_field_text ); |
3539 | 3553 | $field .= $this->render_input_field( 'email', $id, $value, $class, $placeholder, $required ); |
3540 | 3554 | return $field; |
3541 | 3555 | } |
3542 | 3556 | |
3557 | + /** |
|
3558 | + * @param string $class |
|
3559 | + * @param string $placeholder |
|
3560 | + */ |
|
3543 | 3561 | function render_telephone_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3544 | 3562 | $field = $this->render_label( 'telephone', $id, $label, $required, $required_field_text ); |
3545 | 3563 | $field .= $this->render_input_field( 'tel', $id, $value, $class, $placeholder, $required ); |
3546 | 3564 | return $field; |
3547 | 3565 | } |
3548 | 3566 | |
3567 | + /** |
|
3568 | + * @param string $class |
|
3569 | + * @param string $placeholder |
|
3570 | + */ |
|
3549 | 3571 | function render_url_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3550 | 3572 | $field = $this->render_label( 'url', $id, $label, $required, $required_field_text ); |
3551 | 3573 | $field .= $this->render_input_field( 'url', $id, $value, $class, $placeholder, $required ); |
3552 | 3574 | return $field; |
3553 | 3575 | } |
3554 | 3576 | |
3577 | + /** |
|
3578 | + * @param string $class |
|
3579 | + * @param string $placeholder |
|
3580 | + */ |
|
3555 | 3581 | function render_textarea_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3556 | 3582 | $field = $this->render_label( 'textarea', 'contact-form-comment-' . $id, $label, $required, $required_field_text ); |
3557 | 3583 | $field .= "<textarea |
@@ -3566,6 +3592,9 @@ discard block |
||
3566 | 3592 | return $field; |
3567 | 3593 | } |
3568 | 3594 | |
3595 | + /** |
|
3596 | + * @param string $class |
|
3597 | + */ |
|
3569 | 3598 | function render_radio_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3570 | 3599 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
3571 | 3600 | foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
@@ -3587,6 +3616,9 @@ discard block |
||
3587 | 3616 | return $field; |
3588 | 3617 | } |
3589 | 3618 | |
3619 | + /** |
|
3620 | + * @param string $class |
|
3621 | + */ |
|
3590 | 3622 | function render_checkbox_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3591 | 3623 | $field = "<label class='grunion-field-label checkbox" . ( $this->is_error() ? ' form-error' : '' ) . "'>"; |
3592 | 3624 | $field .= "\t\t<input type='checkbox' name='" . esc_attr( $id ) . "' value='" . esc_attr__( 'Yes', 'jetpack' ) . "' " . $class . checked( (bool) $value, true, false ) . ' ' . ( $required ? "required aria-required='true'" : '' ) . "/> \n"; |
@@ -3619,6 +3651,9 @@ discard block |
||
3619 | 3651 | return $field; |
3620 | 3652 | } |
3621 | 3653 | |
3654 | + /** |
|
3655 | + * @param string $class |
|
3656 | + */ |
|
3622 | 3657 | function render_checkbox_multiple_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3623 | 3658 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
3624 | 3659 | foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
@@ -3634,6 +3669,9 @@ discard block |
||
3634 | 3669 | return $field; |
3635 | 3670 | } |
3636 | 3671 | |
3672 | + /** |
|
3673 | + * @param string $class |
|
3674 | + */ |
|
3637 | 3675 | function render_select_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3638 | 3676 | $field = $this->render_label( 'select', $id, $label, $required, $required_field_text ); |
3639 | 3677 | $field .= "\t<select name='" . esc_attr( $id ) . "' id='" . esc_attr( $id ) . "' " . $class . ( $required ? "required aria-required='true'" : '' ) . ">\n"; |
@@ -3651,6 +3689,10 @@ discard block |
||
3651 | 3689 | return $field; |
3652 | 3690 | } |
3653 | 3691 | |
3692 | + /** |
|
3693 | + * @param string $class |
|
3694 | + * @param string $placeholder |
|
3695 | + */ |
|
3654 | 3696 | function render_date_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3655 | 3697 | |
3656 | 3698 | $field = $this->render_label( 'date', $id, $label, $required, $required_field_text ); |
@@ -3681,6 +3723,10 @@ discard block |
||
3681 | 3723 | return $field; |
3682 | 3724 | } |
3683 | 3725 | |
3726 | + /** |
|
3727 | + * @param string $class |
|
3728 | + * @param string $placeholder |
|
3729 | + */ |
|
3684 | 3730 | function render_default_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder, $type ) { |
3685 | 3731 | $field = $this->render_label( $type, $id, $label, $required, $required_field_text ); |
3686 | 3732 | $field .= $this->render_input_field( 'text', $id, $value, $class, $placeholder, $required ); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | /** |
51 | 51 | * Initializer. |
52 | 52 | * |
53 | - * @return object |
|
53 | + * @return Identity_Crisis |
|
54 | 54 | */ |
55 | 55 | public static function init() { |
56 | 56 | if ( is_null( self::$instance ) ) { |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | * This is ported over from the manage module, which has been deprecated and baked in here. |
981 | 981 | * |
982 | 982 | * @param $domains |
983 | - * @return array |
|
983 | + * @return string[] |
|
984 | 984 | */ |
985 | 985 | function allow_wpcom_domain( $domains ) { |
986 | 986 | if ( empty( $domains ) ) { |
@@ -1381,7 +1381,7 @@ discard block |
||
1381 | 1381 | /** |
1382 | 1382 | * Does the network allow admins to add new users. |
1383 | 1383 | * |
1384 | - * @return boolian |
|
1384 | + * @return boolean |
|
1385 | 1385 | */ |
1386 | 1386 | static function network_add_new_users( $option = null ) { |
1387 | 1387 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1491,7 +1491,7 @@ discard block |
||
1491 | 1491 | * |
1492 | 1492 | * @param bool $option |
1493 | 1493 | * |
1494 | - * @return boolean |
|
1494 | + * @return string |
|
1495 | 1495 | */ |
1496 | 1496 | public function is_main_network_option( $option ) { |
1497 | 1497 | // return '1' or '' |
@@ -1502,7 +1502,7 @@ discard block |
||
1502 | 1502 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1503 | 1503 | * |
1504 | 1504 | * @param string $option |
1505 | - * @return boolean |
|
1505 | + * @return string |
|
1506 | 1506 | */ |
1507 | 1507 | public function is_multisite( $option ) { |
1508 | 1508 | return (string) (bool) is_multisite(); |
@@ -1565,7 +1565,7 @@ discard block |
||
1565 | 1565 | /** |
1566 | 1566 | * Returns true if the site has file write access false otherwise. |
1567 | 1567 | * |
1568 | - * @return string ( '1' | '0' ) |
|
1568 | + * @return integer ( '1' | '0' ) |
|
1569 | 1569 | **/ |
1570 | 1570 | public static function file_system_write_access() { |
1571 | 1571 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2273,7 +2273,7 @@ discard block |
||
2273 | 2273 | * @param int $user_id The user id. |
2274 | 2274 | * @param string $token The user token. |
2275 | 2275 | * @param bool $is_master_user Whether the user is the master user. |
2276 | - * @return bool |
|
2276 | + * @return boolean|null |
|
2277 | 2277 | */ |
2278 | 2278 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2279 | 2279 | _deprecated_function( __METHOD__, 'jetpack-9.5', 'Automattic\\Jetpack\\Connection\\Tokens->update_user_token' ); |
@@ -2756,7 +2756,7 @@ discard block |
||
2756 | 2756 | * |
2757 | 2757 | * @param string $tag Tag as it appears in each module heading. |
2758 | 2758 | * |
2759 | - * @return mixed |
|
2759 | + * @return string |
|
2760 | 2760 | */ |
2761 | 2761 | public static function translate_module_tag( $tag ) { |
2762 | 2762 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2871,8 +2871,8 @@ discard block |
||
2871 | 2871 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2872 | 2872 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2873 | 2873 | * |
2874 | - * @param $string |
|
2875 | - * @return mixed |
|
2874 | + * @param string $string |
|
2875 | + * @return string|null |
|
2876 | 2876 | */ |
2877 | 2877 | public static function alias_directories( $string ) { |
2878 | 2878 | // ABSPATH has a trailing slash. |
@@ -2883,6 +2883,11 @@ discard block |
||
2883 | 2883 | return $string; |
2884 | 2884 | } |
2885 | 2885 | |
2886 | + /** |
|
2887 | + * @param boolean $redirect |
|
2888 | + * @param boolean $send_state_messages |
|
2889 | + * @param boolean $requires_user_connection |
|
2890 | + */ |
|
2886 | 2891 | public static function activate_default_modules( |
2887 | 2892 | $min_version = false, |
2888 | 2893 | $max_version = false, |
@@ -3172,6 +3177,9 @@ discard block |
||
3172 | 3177 | return self::update_active_modules( $new ); |
3173 | 3178 | } |
3174 | 3179 | |
3180 | + /** |
|
3181 | + * @param string $module |
|
3182 | + */ |
|
3175 | 3183 | public static function enable_module_configurable( $module ) { |
3176 | 3184 | $module = self::get_module_slug( $module ); |
3177 | 3185 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3200,6 +3208,10 @@ discard block |
||
3200 | 3208 | } |
3201 | 3209 | |
3202 | 3210 | /* Installation */ |
3211 | + |
|
3212 | + /** |
|
3213 | + * @param string $message |
|
3214 | + */ |
|
3203 | 3215 | public static function bail_on_activation( $message, $deactivate = true ) { |
3204 | 3216 | ?> |
3205 | 3217 | <!doctype html> |
@@ -3245,6 +3257,7 @@ discard block |
||
3245 | 3257 | * Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook() |
3246 | 3258 | * |
3247 | 3259 | * @static |
3260 | + * @param boolean $network_wide |
|
3248 | 3261 | */ |
3249 | 3262 | public static function plugin_activation( $network_wide ) { |
3250 | 3263 | Jetpack_Options::update_option( 'activated', 1 ); |
@@ -3961,7 +3974,7 @@ discard block |
||
3961 | 3974 | * Add help to the Jetpack page |
3962 | 3975 | * |
3963 | 3976 | * @since Jetpack (1.2.3) |
3964 | - * @return false if not the Jetpack page |
|
3977 | + * @return false|null if not the Jetpack page |
|
3965 | 3978 | */ |
3966 | 3979 | function admin_help() { |
3967 | 3980 | $current_screen = get_current_screen(); |
@@ -4702,6 +4715,7 @@ discard block |
||
4702 | 4715 | |
4703 | 4716 | /** |
4704 | 4717 | * Record a stat for later output. This will only currently output in the admin_footer. |
4718 | + * @param string $group |
|
4705 | 4719 | */ |
4706 | 4720 | function stat( $group, $detail ) { |
4707 | 4721 | $this->initialize_stats(); |
@@ -5064,6 +5078,9 @@ discard block |
||
5064 | 5078 | return $url; |
5065 | 5079 | } |
5066 | 5080 | |
5081 | + /** |
|
5082 | + * @param string $actionurl |
|
5083 | + */ |
|
5067 | 5084 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
5068 | 5085 | $actionurl = str_replace( '&', '&', $actionurl ); |
5069 | 5086 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -5603,7 +5620,6 @@ discard block |
||
5603 | 5620 | * @deprecated since 8.9.0 |
5604 | 5621 | * @see Automattic\Jetpack\Connection\Rest_Authentication::wp_rest_authentication_errors() |
5605 | 5622 | * |
5606 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5607 | 5623 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5608 | 5624 | */ |
5609 | 5625 | public function wp_rest_authentication_errors( $value ) { |
@@ -5696,6 +5712,7 @@ discard block |
||
5696 | 5712 | * @param string $key |
5697 | 5713 | * @param string $value |
5698 | 5714 | * @param bool $restate private |
5715 | + * @return string |
|
5699 | 5716 | */ |
5700 | 5717 | public static function state( $key = null, $value = null, $restate = false ) { |
5701 | 5718 | static $state = array(); |
@@ -5777,6 +5794,9 @@ discard block |
||
5777 | 5794 | return true; |
5778 | 5795 | } |
5779 | 5796 | |
5797 | + /** |
|
5798 | + * @param string $file |
|
5799 | + */ |
|
5780 | 5800 | public static function check_privacy( $file ) { |
5781 | 5801 | static $is_site_publicly_accessible = null; |
5782 | 5802 | |
@@ -6350,9 +6370,7 @@ discard block |
||
6350 | 6370 | * |
6351 | 6371 | * Attached to `style_loader_src` filter. |
6352 | 6372 | * |
6353 | - * @param string $tag The tag that would link to the external asset. |
|
6354 | 6373 | * @param string $handle The registered handle of the script in question. |
6355 | - * @param string $href The url of the asset in question. |
|
6356 | 6374 | */ |
6357 | 6375 | public static function set_suffix_on_min( $src, $handle ) { |
6358 | 6376 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6728,8 +6746,8 @@ discard block |
||
6728 | 6746 | * - Absolute URLs `http://domain.com/feh.png` |
6729 | 6747 | * - Domain root relative URLs `/feh.png` |
6730 | 6748 | * |
6731 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6732 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6749 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6750 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6733 | 6751 | * |
6734 | 6752 | * @return mixed|string |
6735 | 6753 | */ |
@@ -7031,7 +7049,6 @@ discard block |
||
7031 | 7049 | } |
7032 | 7050 | |
7033 | 7051 | /** |
7034 | - * @param mixed $result Value for the user's option |
|
7035 | 7052 | * @return mixed |
7036 | 7053 | */ |
7037 | 7054 | function get_user_option_meta_box_order_dashboard( $sorted ) { |