| @@ -298,6 +298,9 @@ discard block | ||
| 298 | 298 | return Grunion_Contact_Form::parse( $atts, do_blocks( $content ), true ); | 
| 299 | 299 | } | 
| 300 | 300 | |
| 301 | + /** | |
| 302 | + * @param string $type | |
| 303 | + */ | |
| 301 | 304 |  	public static function block_attributes_to_shortcode_attributes( $atts, $type ) { | 
| 302 | 305 | $atts['type'] = $type; | 
| 303 | 306 |  		if ( isset( $atts['className'] ) ) { | 
| @@ -1928,7 +1931,6 @@ discard block | ||
| 1928 | 1931 | * | 
| 1929 | 1932 | * @see ::style() | 
| 1930 | 1933 | * @internal | 
| 1931 | - * @param bool $style | |
| 1932 | 1934 | */ | 
| 1933 | 1935 |  	static function _style_on() { | 
| 1934 | 1936 | return self::style( true ); | 
| @@ -2113,6 +2115,7 @@ discard block | ||
| 2113 | 2115 | * | 
| 2114 | 2116 | * @param int $feedback_id | 
| 2115 | 2117 | * @param object Grunion_Contact_Form $form | 
| 2118 | + * @param Grunion_Contact_Form $form | |
| 2116 | 2119 | * | 
| 2117 | 2120 | * @return string $message | 
| 2118 | 2121 | */ | 
| @@ -2243,7 +2246,7 @@ discard block | ||
| 2243 | 2246 | * | 
| 2244 | 2247 | * @param array $attributes Key => Value pairs as parsed by shortcode_parse_atts() | 
| 2245 | 2248 | * @param string|null $content The shortcode's inner content: [contact-field]$content[/contact-field] | 
| 2246 | - * @return HTML for the contact form field | |
| 2249 | + * @return string for the contact form field | |
| 2247 | 2250 | */ | 
| 2248 | 2251 |  	static function parse_contact_field( $attributes, $content ) { | 
| 2249 | 2252 | // Don't try to parse contact form fields if not inside a contact form | 
| @@ -3303,6 +3306,9 @@ discard block | ||
| 3303 | 3306 | |
| 3304 | 3307 | } | 
| 3305 | 3308 | |
| 3309 | + /** | |
| 3310 | + * @param string $type | |
| 3311 | + */ | |
| 3306 | 3312 |  	function render_input_field( $type, $id, $value, $class, $placeholder, $required ) { | 
| 3307 | 3313 | return "<input | 
| 3308 | 3314 | type='". esc_attr( $type ) ."' | 
| @@ -3314,24 +3320,40 @@ discard block | ||
| 3314 | 3320 | />\n"; | 
| 3315 | 3321 | } | 
| 3316 | 3322 | |
| 3323 | + /** | |
| 3324 | + * @param string $class | |
| 3325 | + * @param string $placeholder | |
| 3326 | + */ | |
| 3317 | 3327 |  	function render_email_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { | 
| 3318 | 3328 | $field = $this->render_label( 'email', $id, $label, $required, $required_field_text ); | 
| 3319 | 3329 | $field .= $this->render_input_field( 'email', $id, $value, $class, $placeholder, $required ); | 
| 3320 | 3330 | return $field; | 
| 3321 | 3331 | } | 
| 3322 | 3332 | |
| 3333 | + /** | |
| 3334 | + * @param string $class | |
| 3335 | + * @param string $placeholder | |
| 3336 | + */ | |
| 3323 | 3337 |  	function render_telephone_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { | 
| 3324 | 3338 | $field = $this->render_label( 'telephone', $id, $label, $required, $required_field_text ); | 
| 3325 | 3339 | $field .= $this->render_input_field( 'tel', $id, $value, $class, $placeholder, $required ); | 
| 3326 | 3340 | return $field; | 
| 3327 | 3341 | } | 
| 3328 | 3342 | |
| 3343 | + /** | |
| 3344 | + * @param string $class | |
| 3345 | + * @param string $placeholder | |
| 3346 | + */ | |
| 3329 | 3347 |  	function render_url_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { | 
| 3330 | 3348 | $field = $this->render_label( 'url', $id, $label, $required, $required_field_text ); | 
| 3331 | 3349 | $field .= $this->render_input_field( 'url', $id, $value, $class, $placeholder, $required ); | 
| 3332 | 3350 | return $field; | 
| 3333 | 3351 | } | 
| 3334 | 3352 | |
| 3353 | + /** | |
| 3354 | + * @param string $class | |
| 3355 | + * @param string $placeholder | |
| 3356 | + */ | |
| 3335 | 3357 |  	function render_textarea_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { | 
| 3336 | 3358 | $field = $this->render_label( 'textarea', 'contact-form-comment-' . $id, $label, $required, $required_field_text ); | 
| 3337 | 3359 | $field .= "<textarea | 
| @@ -3346,6 +3368,9 @@ discard block | ||
| 3346 | 3368 | return $field; | 
| 3347 | 3369 | } | 
| 3348 | 3370 | |
| 3371 | + /** | |
| 3372 | + * @param string $class | |
| 3373 | + */ | |
| 3349 | 3374 |  	function render_radio_field( $id, $label, $value, $class, $required, $required_field_text ) { | 
| 3350 | 3375 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); | 
| 3351 | 3376 |  		foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { | 
| @@ -3367,6 +3392,9 @@ discard block | ||
| 3367 | 3392 | return $field; | 
| 3368 | 3393 | } | 
| 3369 | 3394 | |
| 3395 | + /** | |
| 3396 | + * @param string $class | |
| 3397 | + */ | |
| 3370 | 3398 |  	function render_checkbox_field( $id, $label, $value, $class, $required, $required_field_text ) { | 
| 3371 | 3399 | $field = "<label class='grunion-field-label checkbox" . ( $this->is_error() ? ' form-error' : '' ) . "'>"; | 
| 3372 | 3400 | $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"; | 
| @@ -3376,6 +3404,9 @@ discard block | ||
| 3376 | 3404 | return $field; | 
| 3377 | 3405 | } | 
| 3378 | 3406 | |
| 3407 | + /** | |
| 3408 | + * @param string $class | |
| 3409 | + */ | |
| 3379 | 3410 |  	function render_checkbox_multiple_field( $id, $label, $value, $class, $required, $required_field_text  ) { | 
| 3380 | 3411 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); | 
| 3381 | 3412 |  		foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { | 
| @@ -3391,6 +3422,9 @@ discard block | ||
| 3391 | 3422 | return $field; | 
| 3392 | 3423 | } | 
| 3393 | 3424 | |
| 3425 | + /** | |
| 3426 | + * @param string $class | |
| 3427 | + */ | |
| 3394 | 3428 |  	function render_select_field( $id, $label, $value, $class, $required, $required_field_text ) { | 
| 3395 | 3429 | $field = $this->render_label( 'select', $id, $label, $required, $required_field_text ); | 
| 3396 | 3430 | $field .= "\t<select name='" . esc_attr( $id ) . "' id='" . esc_attr( $id ) . "' " . $class . ( $required ? "required aria-required='true'" : '' ) . ">\n"; | 
| @@ -3408,6 +3442,10 @@ discard block | ||
| 3408 | 3442 | return $field; | 
| 3409 | 3443 | } | 
| 3410 | 3444 | |
| 3445 | + /** | |
| 3446 | + * @param string $class | |
| 3447 | + * @param string $placeholder | |
| 3448 | + */ | |
| 3411 | 3449 |  	function render_date_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { | 
| 3412 | 3450 | |
| 3413 | 3451 | $field = $this->render_label( 'date', $id, $label, $required, $required_field_text ); | 
| @@ -3438,6 +3476,10 @@ discard block | ||
| 3438 | 3476 | return $field; | 
| 3439 | 3477 | } | 
| 3440 | 3478 | |
| 3479 | + /** | |
| 3480 | + * @param string $class | |
| 3481 | + * @param string $placeholder | |
| 3482 | + */ | |
| 3441 | 3483 |  	function render_default_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder, $type ) { | 
| 3442 | 3484 | $field = $this->render_label( $type, $id, $label, $required, $required_field_text ); | 
| 3443 | 3485 | $field .= $this->render_input_field( 'text', $id, $value, $class, $placeholder, $required ); |