@@ -298,6 +298,9 @@ discard block |
||
298 | 298 | return Grunion_Contact_Form::parse( $atts, do_blocks( $content ) ); |
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'] ) ) { |
@@ -1926,7 +1929,6 @@ discard block |
||
1926 | 1929 | * |
1927 | 1930 | * @see ::style() |
1928 | 1931 | * @internal |
1929 | - * @param bool $style |
|
1930 | 1932 | */ |
1931 | 1933 | static function _style_on() { |
1932 | 1934 | return self::style( true ); |
@@ -2101,6 +2103,7 @@ discard block |
||
2101 | 2103 | * |
2102 | 2104 | * @param int $feedback_id |
2103 | 2105 | * @param object Grunion_Contact_Form $form |
2106 | + * @param Grunion_Contact_Form $form |
|
2104 | 2107 | * |
2105 | 2108 | * @return string $message |
2106 | 2109 | */ |
@@ -2231,7 +2234,7 @@ discard block |
||
2231 | 2234 | * |
2232 | 2235 | * @param array $attributes Key => Value pairs as parsed by shortcode_parse_atts() |
2233 | 2236 | * @param string|null $content The shortcode's inner content: [contact-field]$content[/contact-field] |
2234 | - * @return HTML for the contact form field |
|
2237 | + * @return string for the contact form field |
|
2235 | 2238 | */ |
2236 | 2239 | static function parse_contact_field( $attributes, $content ) { |
2237 | 2240 | // Don't try to parse contact form fields if not inside a contact form |
@@ -3291,6 +3294,9 @@ discard block |
||
3291 | 3294 | |
3292 | 3295 | } |
3293 | 3296 | |
3297 | + /** |
|
3298 | + * @param string $type |
|
3299 | + */ |
|
3294 | 3300 | function render_input_field( $type, $id, $value, $class, $placeholder, $required ) { |
3295 | 3301 | return "<input |
3296 | 3302 | type='". esc_attr( $type ) ."' |
@@ -3302,24 +3308,40 @@ discard block |
||
3302 | 3308 | />\n"; |
3303 | 3309 | } |
3304 | 3310 | |
3311 | + /** |
|
3312 | + * @param string $class |
|
3313 | + * @param string $placeholder |
|
3314 | + */ |
|
3305 | 3315 | function render_email_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3306 | 3316 | $field = $this->render_label( 'email', $id, $label, $required, $required_field_text ); |
3307 | 3317 | $field .= $this->render_input_field( 'email', $id, $value, $class, $placeholder, $required ); |
3308 | 3318 | return $field; |
3309 | 3319 | } |
3310 | 3320 | |
3321 | + /** |
|
3322 | + * @param string $class |
|
3323 | + * @param string $placeholder |
|
3324 | + */ |
|
3311 | 3325 | function render_telephone_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3312 | 3326 | $field = $this->render_label( 'telephone', $id, $label, $required, $required_field_text ); |
3313 | 3327 | $field .= $this->render_input_field( 'tel', $id, $value, $class, $placeholder, $required ); |
3314 | 3328 | return $field; |
3315 | 3329 | } |
3316 | 3330 | |
3331 | + /** |
|
3332 | + * @param string $class |
|
3333 | + * @param string $placeholder |
|
3334 | + */ |
|
3317 | 3335 | function render_url_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3318 | 3336 | $field = $this->render_label( 'url', $id, $label, $required, $required_field_text ); |
3319 | 3337 | $field .= $this->render_input_field( 'url', $id, $value, $class, $placeholder, $required ); |
3320 | 3338 | return $field; |
3321 | 3339 | } |
3322 | 3340 | |
3341 | + /** |
|
3342 | + * @param string $class |
|
3343 | + * @param string $placeholder |
|
3344 | + */ |
|
3323 | 3345 | function render_textarea_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3324 | 3346 | $field = $this->render_label( 'textarea', 'contact-form-comment-' . $id, $label, $required, $required_field_text ); |
3325 | 3347 | $field .= "<textarea |
@@ -3334,6 +3356,9 @@ discard block |
||
3334 | 3356 | return $field; |
3335 | 3357 | } |
3336 | 3358 | |
3359 | + /** |
|
3360 | + * @param string $class |
|
3361 | + */ |
|
3337 | 3362 | function render_radio_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3338 | 3363 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
3339 | 3364 | foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
@@ -3355,6 +3380,9 @@ discard block |
||
3355 | 3380 | return $field; |
3356 | 3381 | } |
3357 | 3382 | |
3383 | + /** |
|
3384 | + * @param string $class |
|
3385 | + */ |
|
3358 | 3386 | function render_checkbox_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3359 | 3387 | $field = "<label class='grunion-field-label checkbox" . ( $this->is_error() ? ' form-error' : '' ) . "'>"; |
3360 | 3388 | $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"; |
@@ -3364,6 +3392,9 @@ discard block |
||
3364 | 3392 | return $field; |
3365 | 3393 | } |
3366 | 3394 | |
3395 | + /** |
|
3396 | + * @param string $class |
|
3397 | + */ |
|
3367 | 3398 | function render_checkbox_multiple_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3368 | 3399 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
3369 | 3400 | foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
@@ -3379,6 +3410,9 @@ discard block |
||
3379 | 3410 | return $field; |
3380 | 3411 | } |
3381 | 3412 | |
3413 | + /** |
|
3414 | + * @param string $class |
|
3415 | + */ |
|
3382 | 3416 | function render_select_field( $id, $label, $value, $class, $required, $required_field_text ) { |
3383 | 3417 | $field = $this->render_label( 'select', $id, $label, $required, $required_field_text ); |
3384 | 3418 | $field .= "\t<select name='" . esc_attr( $id ) . "' id='" . esc_attr( $id ) . "' " . $class . ( $required ? "required aria-required='true'" : '' ) . ">\n"; |
@@ -3396,6 +3430,10 @@ discard block |
||
3396 | 3430 | return $field; |
3397 | 3431 | } |
3398 | 3432 | |
3433 | + /** |
|
3434 | + * @param string $class |
|
3435 | + * @param string $placeholder |
|
3436 | + */ |
|
3399 | 3437 | function render_date_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
3400 | 3438 | |
3401 | 3439 | $field = $this->render_label( 'date', $id, $label, $required, $required_field_text ); |
@@ -3426,6 +3464,10 @@ discard block |
||
3426 | 3464 | return $field; |
3427 | 3465 | } |
3428 | 3466 | |
3467 | + /** |
|
3468 | + * @param string $class |
|
3469 | + * @param string $placeholder |
|
3470 | + */ |
|
3429 | 3471 | function render_default_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder, $type ) { |
3430 | 3472 | $field = $this->render_label( $type, $id, $label, $required, $required_field_text ); |
3431 | 3473 | $field .= $this->render_input_field( 'text', $id, $value, $class, $placeholder, $required ); |
@@ -3609,7 +3651,6 @@ discard block |
||
3609 | 3651 | * @param int $post_id - the post_id for the CPT that is created. |
3610 | 3652 | * @param array $all_values - fields from the default contact form. |
3611 | 3653 | * @param array $extra_values - extra fields added to from the contact form. |
3612 | - * @param array $plugin - an instance of the plugin |
|
3613 | 3654 | * |
3614 | 3655 | * @return null|void |
3615 | 3656 | */ |