@@ -129,7 +129,7 @@ |
||
129 | 129 | * |
130 | 130 | * @param string $group Testing group to check status of. Optional, default all tests. |
131 | 131 | * |
132 | - * @return true|array True if all tests pass. Array of failed tests. |
|
132 | + * @return boolean True if all tests pass. Array of failed tests. |
|
133 | 133 | */ |
134 | 134 | public function pass( $group = 'default' ) { |
135 | 135 | $results = $this->raw_results( $group ); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Verifies that a user answered the math problem correctly while logging in. |
28 | 28 | * |
29 | - * @return bool Returns true if the math is correct |
|
29 | + * @return boolean|null Returns true if the math is correct |
|
30 | 30 | * @throws Error if insuffient $_POST variables are present. |
31 | 31 | * @throws Error message if the math is wrong |
32 | 32 | */ |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * Requires a user to solve a simple equation. Added to any WordPress login form. |
111 | 111 | * |
112 | - * @return VOID outputs html |
|
112 | + * @return string|null outputs html |
|
113 | 113 | */ |
114 | 114 | static function math_form() { |
115 | 115 | // Check if jpp_math_pass cookie is set and it matches valid transient |
@@ -33,6 +33,9 @@ discard block |
||
33 | 33 | public $extra_headers = array(); |
34 | 34 | |
35 | 35 | /** |
36 | + * @param string $method |
|
37 | + * @param string $url |
|
38 | + * @param string $post_body |
|
36 | 39 | * @return WPCOM_JSON_API instance |
37 | 40 | */ |
38 | 41 | static function init( $method = null, $url = null, $post_body = null ) { |
@@ -335,6 +338,9 @@ discard block |
||
335 | 338 | return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); |
336 | 339 | } |
337 | 340 | |
341 | + /** |
|
342 | + * @param integer $status_code |
|
343 | + */ |
|
338 | 344 | function output_early( $status_code, $response = null, $content_type = 'application/json' ) { |
339 | 345 | $exit = $this->exit; |
340 | 346 | $this->exit = false; |
@@ -543,11 +549,18 @@ discard block |
||
543 | 549 | return json_encode( $data ); |
544 | 550 | } |
545 | 551 | |
552 | + /** |
|
553 | + * @param string $needle |
|
554 | + */ |
|
546 | 555 | function ends_with( $haystack, $needle ) { |
547 | 556 | return $needle === substr( $haystack, -strlen( $needle ) ); |
548 | 557 | } |
549 | 558 | |
550 | 559 | // Returns the site's blog_id in the WP.com ecosystem |
560 | + |
|
561 | + /** |
|
562 | + * @return integer |
|
563 | + */ |
|
551 | 564 | function get_blog_id_for_output() { |
552 | 565 | return $this->token_details['blog_id']; |
553 | 566 | } |
@@ -570,6 +583,10 @@ discard block |
||
570 | 583 | } |
571 | 584 | |
572 | 585 | // Returns true if the specified blog ID is a restricted blog |
586 | + |
|
587 | + /** |
|
588 | + * @param integer $blog_id |
|
589 | + */ |
|
573 | 590 | function is_restricted_blog( $blog_id ) { |
574 | 591 | /** |
575 | 592 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |
@@ -619,7 +636,7 @@ discard block |
||
619 | 636 | /** |
620 | 637 | * Counts the number of comments on a site, excluding certain comment types. |
621 | 638 | * |
622 | - * @param $post_id int Post ID. |
|
639 | + * @param integer $post_id int Post ID. |
|
623 | 640 | * @return array Array of counts, matching the output of https://developer.wordpress.org/reference/functions/get_comment_count/. |
624 | 641 | */ |
625 | 642 | public function wp_count_comments( $post_id ) { |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | } |
1223 | 1223 | /** |
1224 | 1224 | * Does the network allow admins to add new users. |
1225 | - * @return boolian |
|
1225 | + * @return boolean |
|
1226 | 1226 | */ |
1227 | 1227 | static function network_add_new_users( $option = null ) { |
1228 | 1228 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1327,7 +1327,7 @@ discard block |
||
1327 | 1327 | * database which could be set to anything as opposed to what this function returns. |
1328 | 1328 | * @param bool $option |
1329 | 1329 | * |
1330 | - * @return boolean |
|
1330 | + * @return string |
|
1331 | 1331 | */ |
1332 | 1332 | public function is_main_network_option( $option ) { |
1333 | 1333 | // return '1' or '' |
@@ -1338,7 +1338,7 @@ discard block |
||
1338 | 1338 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1339 | 1339 | * |
1340 | 1340 | * @param string $option |
1341 | - * @return boolean |
|
1341 | + * @return string |
|
1342 | 1342 | */ |
1343 | 1343 | public function is_multisite( $option ) { |
1344 | 1344 | return (string) (bool) is_multisite(); |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | |
1401 | 1401 | /** |
1402 | 1402 | * Returns true if the site has file write access false otherwise. |
1403 | - * @return string ( '1' | '0' ) |
|
1403 | + * @return integer ( '1' | '0' ) |
|
1404 | 1404 | **/ |
1405 | 1405 | public static function file_system_write_access() { |
1406 | 1406 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2256,6 +2256,7 @@ discard block |
||
2256 | 2256 | * @param int $user_id |
2257 | 2257 | * @param string $token |
2258 | 2258 | * return bool |
2259 | + * @param boolean $is_master_user |
|
2259 | 2260 | */ |
2260 | 2261 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2261 | 2262 | // not designed for concurrent updates |
@@ -2658,6 +2659,7 @@ discard block |
||
2658 | 2659 | |
2659 | 2660 | /** |
2660 | 2661 | * Like core's get_file_data implementation, but caches the result. |
2662 | + * @param string $file |
|
2661 | 2663 | */ |
2662 | 2664 | public static function get_file_data( $file, $headers ) { |
2663 | 2665 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2694,7 +2696,7 @@ discard block |
||
2694 | 2696 | * |
2695 | 2697 | * @param string $tag Tag as it appears in each module heading. |
2696 | 2698 | * |
2697 | - * @return mixed |
|
2699 | + * @return string |
|
2698 | 2700 | */ |
2699 | 2701 | public static function translate_module_tag( $tag ) { |
2700 | 2702 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2859,8 +2861,8 @@ discard block |
||
2859 | 2861 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2860 | 2862 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2861 | 2863 | * |
2862 | - * @param $string |
|
2863 | - * @return mixed |
|
2864 | + * @param string $string |
|
2865 | + * @return string|null |
|
2864 | 2866 | */ |
2865 | 2867 | public static function alias_directories( $string ) { |
2866 | 2868 | // ABSPATH has a trailing slash. |
@@ -3140,6 +3142,9 @@ discard block |
||
3140 | 3142 | return self::update_active_modules( $new ); |
3141 | 3143 | } |
3142 | 3144 | |
3145 | + /** |
|
3146 | + * @param string $module |
|
3147 | + */ |
|
3143 | 3148 | public static function enable_module_configurable( $module ) { |
3144 | 3149 | $module = Jetpack::get_module_slug( $module ); |
3145 | 3150 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3167,21 +3172,33 @@ discard block |
||
3167 | 3172 | return $url; |
3168 | 3173 | } |
3169 | 3174 | |
3175 | + /** |
|
3176 | + * @param string $module |
|
3177 | + */ |
|
3170 | 3178 | public static function module_configuration_load( $module, $method ) { |
3171 | 3179 | $module = Jetpack::get_module_slug( $module ); |
3172 | 3180 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
3173 | 3181 | } |
3174 | 3182 | |
3183 | + /** |
|
3184 | + * @param string $module |
|
3185 | + */ |
|
3175 | 3186 | public static function module_configuration_head( $module, $method ) { |
3176 | 3187 | $module = Jetpack::get_module_slug( $module ); |
3177 | 3188 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
3178 | 3189 | } |
3179 | 3190 | |
3191 | + /** |
|
3192 | + * @param string $module |
|
3193 | + */ |
|
3180 | 3194 | public static function module_configuration_screen( $module, $method ) { |
3181 | 3195 | $module = Jetpack::get_module_slug( $module ); |
3182 | 3196 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
3183 | 3197 | } |
3184 | 3198 | |
3199 | + /** |
|
3200 | + * @param string $module |
|
3201 | + */ |
|
3185 | 3202 | public static function module_configuration_activation_screen( $module, $method ) { |
3186 | 3203 | $module = Jetpack::get_module_slug( $module ); |
3187 | 3204 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -3189,6 +3206,9 @@ discard block |
||
3189 | 3206 | |
3190 | 3207 | /* Installation */ |
3191 | 3208 | |
3209 | + /** |
|
3210 | + * @param string $message |
|
3211 | + */ |
|
3192 | 3212 | public static function bail_on_activation( $message, $deactivate = true ) { |
3193 | 3213 | ?> |
3194 | 3214 | <!doctype html> |
@@ -3949,7 +3969,7 @@ discard block |
||
3949 | 3969 | * Add help to the Jetpack page |
3950 | 3970 | * |
3951 | 3971 | * @since Jetpack (1.2.3) |
3952 | - * @return false if not the Jetpack page |
|
3972 | + * @return false|null if not the Jetpack page |
|
3953 | 3973 | */ |
3954 | 3974 | function admin_help() { |
3955 | 3975 | $current_screen = get_current_screen(); |
@@ -4845,6 +4865,9 @@ discard block |
||
4845 | 4865 | return $url; |
4846 | 4866 | } |
4847 | 4867 | |
4868 | + /** |
|
4869 | + * @return string |
|
4870 | + */ |
|
4848 | 4871 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
4849 | 4872 | $actionurl = str_replace( '&', '&', $actionurl ); |
4850 | 4873 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -5056,6 +5079,7 @@ discard block |
||
5056 | 5079 | /** |
5057 | 5080 | * Returns the requested Jetpack API URL |
5058 | 5081 | * |
5082 | + * @param string $relative_url |
|
5059 | 5083 | * @return string |
5060 | 5084 | */ |
5061 | 5085 | public static function api_url( $relative_url ) { |
@@ -5247,6 +5271,7 @@ discard block |
||
5247 | 5271 | * Note these tokens are unique per call, NOT static per site for connecting. |
5248 | 5272 | * |
5249 | 5273 | * @since 2.6 |
5274 | + * @param string $action |
|
5250 | 5275 | * @return array |
5251 | 5276 | */ |
5252 | 5277 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
@@ -5780,7 +5805,6 @@ discard block |
||
5780 | 5805 | /** |
5781 | 5806 | * Report authentication status to the WP REST API. |
5782 | 5807 | * |
5783 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5784 | 5808 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5785 | 5809 | */ |
5786 | 5810 | public function wp_rest_authentication_errors( $value ) { |
@@ -5790,6 +5814,10 @@ discard block |
||
5790 | 5814 | return $this->rest_authentication_status; |
5791 | 5815 | } |
5792 | 5816 | |
5817 | + /** |
|
5818 | + * @param integer $timestamp |
|
5819 | + * @param string $nonce |
|
5820 | + */ |
|
5793 | 5821 | function add_nonce( $timestamp, $nonce ) { |
5794 | 5822 | global $wpdb; |
5795 | 5823 | static $nonces_used_this_request = array(); |
@@ -5935,6 +5963,7 @@ discard block |
||
5935 | 5963 | * @param string $key |
5936 | 5964 | * @param string $value |
5937 | 5965 | * @param bool $restate private |
5966 | + * @return string |
|
5938 | 5967 | */ |
5939 | 5968 | public static function state( $key = null, $value = null, $restate = false ) { |
5940 | 5969 | static $state = array(); |
@@ -5991,6 +6020,9 @@ discard block |
||
5991 | 6020 | Jetpack::state( null, null, true ); |
5992 | 6021 | } |
5993 | 6022 | |
6023 | + /** |
|
6024 | + * @param string $file |
|
6025 | + */ |
|
5994 | 6026 | public static function check_privacy( $file ) { |
5995 | 6027 | static $is_site_publicly_accessible = null; |
5996 | 6028 | |
@@ -6608,9 +6640,7 @@ discard block |
||
6608 | 6640 | * |
6609 | 6641 | * Attached to `style_loader_src` filter. |
6610 | 6642 | * |
6611 | - * @param string $tag The tag that would link to the external asset. |
|
6612 | 6643 | * @param string $handle The registered handle of the script in question. |
6613 | - * @param string $href The url of the asset in question. |
|
6614 | 6644 | */ |
6615 | 6645 | public static function set_suffix_on_min( $src, $handle ) { |
6616 | 6646 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6791,8 +6821,8 @@ discard block |
||
6791 | 6821 | * - Absolute URLs `http://domain.com/feh.png` |
6792 | 6822 | * - Domain root relative URLs `/feh.png` |
6793 | 6823 | * |
6794 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6795 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6824 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6825 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6796 | 6826 | * |
6797 | 6827 | * @return mixed|string |
6798 | 6828 | */ |
@@ -7021,7 +7051,7 @@ discard block |
||
7021 | 7051 | * |
7022 | 7052 | * @param string $option_name |
7023 | 7053 | * |
7024 | - * @return bool |
|
7054 | + * @return false|null |
|
7025 | 7055 | */ |
7026 | 7056 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
7027 | 7057 | // Bail if Jump Start has already been dismissed |
@@ -7062,7 +7092,7 @@ discard block |
||
7062 | 7092 | /** |
7063 | 7093 | * Stores and prints out domains to prefetch for page speed optimization. |
7064 | 7094 | * |
7065 | - * @param mixed $new_urls |
|
7095 | + * @param string[] $new_urls |
|
7066 | 7096 | */ |
7067 | 7097 | public static function dns_prefetch( $new_urls = null ) { |
7068 | 7098 | static $prefetch_urls = array(); |
@@ -7108,7 +7138,6 @@ discard block |
||
7108 | 7138 | } |
7109 | 7139 | |
7110 | 7140 | /** |
7111 | - * @param mixed $result Value for the user's option |
|
7112 | 7141 | * @return mixed |
7113 | 7142 | */ |
7114 | 7143 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -135,6 +135,9 @@ discard block |
||
135 | 135 | exit; |
136 | 136 | } |
137 | 137 | |
138 | + /** |
|
139 | + * @param string $version |
|
140 | + */ |
|
138 | 141 | function asset_version( $version ) { |
139 | 142 | /** |
140 | 143 | * Filter the version string used when enqueuing Carousel assets. |
@@ -508,6 +511,9 @@ discard block |
||
508 | 511 | return $attr; |
509 | 512 | } |
510 | 513 | |
514 | + /** |
|
515 | + * @param string $html |
|
516 | + */ |
|
511 | 517 | function add_data_to_container( $html ) { |
512 | 518 | global $post; |
513 | 519 | if ( Jetpack_AMP_Support::is_amp_request() ) { |
@@ -751,6 +757,9 @@ discard block |
||
751 | 757 | return ( 1 == $value ) ? 1 : 0; |
752 | 758 | } |
753 | 759 | |
760 | + /** |
|
761 | + * @param string $name |
|
762 | + */ |
|
754 | 763 | function settings_checkbox( $name, $label_text, $extra_text = '', $default_to_checked = true ) { |
755 | 764 | if ( empty( $name ) ) { |
756 | 765 | return; |
@@ -766,6 +775,9 @@ discard block |
||
766 | 775 | echo '</fieldset>'; |
767 | 776 | } |
768 | 777 | |
778 | + /** |
|
779 | + * @param string $name |
|
780 | + */ |
|
769 | 781 | function settings_select( $name, $values, $extra_text = '' ) { |
770 | 782 | if ( empty( $name ) || ! is_array( $values ) || empty( $values ) ) { |
771 | 783 | return; |
@@ -363,7 +363,7 @@ |
||
363 | 363 | * Only enqueue block assets when needed. |
364 | 364 | * |
365 | 365 | * @param string $type slug of the block. |
366 | - * @param array $script_dependencies An array of view-side Javascript dependencies to be enqueued. |
|
366 | + * @param string[] $script_dependencies An array of view-side Javascript dependencies to be enqueued. |
|
367 | 367 | * |
368 | 368 | * @return void |
369 | 369 | */ |
@@ -135,6 +135,9 @@ discard block |
||
135 | 135 | self::set_is_sending( null ); |
136 | 136 | } |
137 | 137 | |
138 | + /** |
|
139 | + * @param boolean|null $is_importing |
|
140 | + */ |
|
138 | 141 | static function set_importing( $is_importing ) { |
139 | 142 | // set to NULL to revert to WP_IMPORTING, the standard behavior |
140 | 143 | self::$is_importing = $is_importing; |
@@ -165,6 +168,9 @@ discard block |
||
165 | 168 | return (bool) self::$is_syncing || ( defined( 'REST_API_REQUEST' ) && REST_API_REQUEST ); |
166 | 169 | } |
167 | 170 | |
171 | + /** |
|
172 | + * @param boolean|null $is_syncing |
|
173 | + */ |
|
168 | 174 | static function set_is_syncing( $is_syncing ) { |
169 | 175 | self::$is_syncing = $is_syncing; |
170 | 176 | } |
@@ -173,6 +179,9 @@ discard block |
||
173 | 179 | return (bool) self::$is_sending; |
174 | 180 | } |
175 | 181 | |
182 | + /** |
|
183 | + * @param boolean|null $is_sending |
|
184 | + */ |
|
176 | 185 | static function set_is_sending( $is_sending ) { |
177 | 186 | self::$is_sending = $is_sending; |
178 | 187 | } |
@@ -300,6 +300,9 @@ discard block |
||
300 | 300 | return Grunion_Contact_Form::parse( $atts, do_blocks( $content ) ); |
301 | 301 | } |
302 | 302 | |
303 | + /** |
|
304 | + * @param string $type |
|
305 | + */ |
|
303 | 306 | public static function block_attributes_to_shortcode_attributes( $atts, $type ) { |
304 | 307 | $atts['type'] = $type; |
305 | 308 | if ( isset( $atts['className'] ) ) { |
@@ -1918,7 +1921,6 @@ discard block |
||
1918 | 1921 | * |
1919 | 1922 | * @see ::style() |
1920 | 1923 | * @internal |
1921 | - * @param bool $style |
|
1922 | 1924 | */ |
1923 | 1925 | static function _style_on() { |
1924 | 1926 | return self::style( true ); |
@@ -2086,6 +2088,7 @@ discard block |
||
2086 | 2088 | * |
2087 | 2089 | * @param int $feedback_id |
2088 | 2090 | * @param object Grunion_Contact_Form $form |
2091 | + * @param Grunion_Contact_Form $form |
|
2089 | 2092 | * |
2090 | 2093 | * @return string $message |
2091 | 2094 | */ |
@@ -2210,7 +2213,7 @@ discard block |
||
2210 | 2213 | * |
2211 | 2214 | * @param array $attributes Key => Value pairs as parsed by shortcode_parse_atts() |
2212 | 2215 | * @param string|null $content The shortcode's inner content: [contact-field]$content[/contact-field] |
2213 | - * @return HTML for the contact form field |
|
2216 | + * @return string for the contact form field |
|
2214 | 2217 | */ |
2215 | 2218 | static function parse_contact_field( $attributes, $content ) { |
2216 | 2219 | // Don't try to parse contact form fields if not inside a contact form |
@@ -3233,6 +3236,9 @@ discard block |
||
3233 | 3236 | |
3234 | 3237 | } |
3235 | 3238 | |
3239 | + /** |
|
3240 | + * @param string $type |
|
3241 | + */ |
|
3236 | 3242 | function render_input_field( $type, $id, $value, $class, $placeholder, $required ) { |
3237 | 3243 | return "<input |
3238 | 3244 | type='". esc_attr( $type ) ."' |
@@ -3244,24 +3250,40 @@ discard block |
||
3244 | 3250 | />\n"; |
3245 | 3251 | } |
3246 | 3252 | |
3253 | + /** |
|
3254 | + * @param string $class |
|
3255 | + * @param string $placeholder |
|
3256 | + */ |
|
3247 | 3257 | function render_email_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3248 | 3258 | $field = $this->render_label( 'email', $id, $label, $required, $required_field_text ); |
3249 | 3259 | $field .= $this->render_input_field( 'email', $id, $value, $class, $placeholder, $required ); |
3250 | 3260 | return $field; |
3251 | 3261 | } |
3252 | 3262 | |
3263 | + /** |
|
3264 | + * @param string $class |
|
3265 | + * @param string $placeholder |
|
3266 | + */ |
|
3253 | 3267 | function render_telephone_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3254 | 3268 | $field = $this->render_label( 'telephone', $id, $label, $required, $required_field_text ); |
3255 | 3269 | $field .= $this->render_input_field( 'tel', $id, $value, $class, $placeholder, $required ); |
3256 | 3270 | return $field; |
3257 | 3271 | } |
3258 | 3272 | |
3273 | + /** |
|
3274 | + * @param string $class |
|
3275 | + * @param string $placeholder |
|
3276 | + */ |
|
3259 | 3277 | function render_url_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3260 | 3278 | $field = $this->render_label( 'url', $id, $label, $required, $required_field_text ); |
3261 | 3279 | $field .= $this->render_input_field( 'url', $id, $value, $class, $placeholder, $required ); |
3262 | 3280 | return $field; |
3263 | 3281 | } |
3264 | 3282 | |
3283 | + /** |
|
3284 | + * @param string $class |
|
3285 | + * @param string $placeholder |
|
3286 | + */ |
|
3265 | 3287 | function render_textarea_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3266 | 3288 | $field = $this->render_label( 'textarea', 'contact-form-comment-' . $id, $label, $required, $required_field_text ); |
3267 | 3289 | $field .= "<textarea |
@@ -3276,6 +3298,9 @@ discard block |
||
3276 | 3298 | return $field; |
3277 | 3299 | } |
3278 | 3300 | |
3301 | + /** |
|
3302 | + * @param string $class |
|
3303 | + */ |
|
3279 | 3304 | function render_radio_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3280 | 3305 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
3281 | 3306 | foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
@@ -3297,6 +3322,9 @@ discard block |
||
3297 | 3322 | return $field; |
3298 | 3323 | } |
3299 | 3324 | |
3325 | + /** |
|
3326 | + * @param string $class |
|
3327 | + */ |
|
3300 | 3328 | function render_checkbox_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3301 | 3329 | $field = "<label class='grunion-field-label checkbox" . ( $this->is_error() ? ' form-error' : '' ) . "'>"; |
3302 | 3330 | $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"; |
@@ -3306,6 +3334,9 @@ discard block |
||
3306 | 3334 | return $field; |
3307 | 3335 | } |
3308 | 3336 | |
3337 | + /** |
|
3338 | + * @param string $class |
|
3339 | + */ |
|
3309 | 3340 | function render_checkbox_multiple_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3310 | 3341 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
3311 | 3342 | foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
@@ -3321,6 +3352,9 @@ discard block |
||
3321 | 3352 | return $field; |
3322 | 3353 | } |
3323 | 3354 | |
3355 | + /** |
|
3356 | + * @param string $class |
|
3357 | + */ |
|
3324 | 3358 | function render_select_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3325 | 3359 | $field = $this->render_label( 'select', $id, $label, $required, $required_field_text ); |
3326 | 3360 | $field .= "\t<select name='" . esc_attr( $id ) . "' id='" . esc_attr( $id ) . "' " . $class . ( $required ? "required aria-required='true'" : '' ) . ">\n"; |
@@ -3338,6 +3372,10 @@ discard block |
||
3338 | 3372 | return $field; |
3339 | 3373 | } |
3340 | 3374 | |
3375 | + /** |
|
3376 | + * @param string $class |
|
3377 | + * @param string $placeholder |
|
3378 | + */ |
|
3341 | 3379 | function render_date_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3342 | 3380 | $field = $this->render_label( 'date', $id, $label, $required, $required_field_text ); |
3343 | 3381 | $field .= $this->render_input_field( 'text', $id, $value, $class, $placeholder, $required ); |
@@ -3357,6 +3395,10 @@ discard block |
||
3357 | 3395 | return $field; |
3358 | 3396 | } |
3359 | 3397 | |
3398 | + /** |
|
3399 | + * @param string $class |
|
3400 | + * @param string $placeholder |
|
3401 | + */ |
|
3360 | 3402 | function render_default_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder, $type ) { |
3361 | 3403 | $field = $this->render_label( $type, $id, $label, $required, $required_field_text ); |
3362 | 3404 | $field .= $this->render_input_field( 'text', $id, $value, $class, $placeholder, $required ); |
@@ -415,7 +415,7 @@ |
||
415 | 415 | * |
416 | 416 | * @param array $connections_data |
417 | 417 | * |
418 | - * @return array { |
|
418 | + * @return string { |
|
419 | 419 | * Array of content for generating connection form. |
420 | 420 | * |
421 | 421 | * @type string HTML content of form |