@@ -283,6 +283,9 @@ discard block |
||
| 283 | 283 | return Grunion_Contact_Form::parse( $atts, do_blocks( $content ) ); |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | + /** |
|
| 287 | + * @param string $type |
|
| 288 | + */ |
|
| 286 | 289 | public static function guten_block_attrebutes_to_shotcode_attributes( $atts, $type ) { |
| 287 | 290 | $atts['type'] = $type; |
| 288 | 291 | if ( isset( $atts['className'] ) ) { |
@@ -1872,7 +1875,6 @@ discard block |
||
| 1872 | 1875 | * |
| 1873 | 1876 | * @see ::style() |
| 1874 | 1877 | * @internal |
| 1875 | - * @param bool $style |
|
| 1876 | 1878 | */ |
| 1877 | 1879 | static function _style_on() { |
| 1878 | 1880 | return self::style( true ); |
@@ -2017,6 +2019,7 @@ discard block |
||
| 2017 | 2019 | * |
| 2018 | 2020 | * @param int $feedback_id |
| 2019 | 2021 | * @param object Grunion_Contact_Form $form |
| 2022 | + * @param Grunion_Contact_Form $form |
|
| 2020 | 2023 | * |
| 2021 | 2024 | * @return string $message |
| 2022 | 2025 | */ |
@@ -2129,7 +2132,7 @@ discard block |
||
| 2129 | 2132 | * |
| 2130 | 2133 | * @param array $attributes Key => Value pairs as parsed by shortcode_parse_atts() |
| 2131 | 2134 | * @param string|null $content The shortcode's inner content: [contact-field]$content[/contact-field] |
| 2132 | - * @return HTML for the contact form field |
|
| 2135 | + * @return string for the contact form field |
|
| 2133 | 2136 | */ |
| 2134 | 2137 | static function parse_contact_field( $attributes, $content ) { |
| 2135 | 2138 | // Don't try to parse contact form fields if not inside a contact form |
@@ -3152,6 +3155,9 @@ discard block |
||
| 3152 | 3155 | |
| 3153 | 3156 | } |
| 3154 | 3157 | |
| 3158 | + /** |
|
| 3159 | + * @param string $type |
|
| 3160 | + */ |
|
| 3155 | 3161 | function render_input_field( $type, $id, $value, $class, $placeholder, $required ) { |
| 3156 | 3162 | return "<input |
| 3157 | 3163 | type='". esc_attr( $type ) ."' |
@@ -3163,24 +3169,40 @@ discard block |
||
| 3163 | 3169 | />\n"; |
| 3164 | 3170 | } |
| 3165 | 3171 | |
| 3172 | + /** |
|
| 3173 | + * @param string $class |
|
| 3174 | + * @param string $placeholder |
|
| 3175 | + */ |
|
| 3166 | 3176 | function render_email_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3167 | 3177 | $field = $this->render_label( 'email', $id, $label, $required, $required_field_text ); |
| 3168 | 3178 | $field .= $this->render_input_field( 'email', $id, $value, $class, $placeholder, $required ); |
| 3169 | 3179 | return $field; |
| 3170 | 3180 | } |
| 3171 | 3181 | |
| 3182 | + /** |
|
| 3183 | + * @param string $class |
|
| 3184 | + * @param string $placeholder |
|
| 3185 | + */ |
|
| 3172 | 3186 | function render_telephone_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3173 | 3187 | $field = $this->render_label( 'telephone', $id, $label, $required, $required_field_text ); |
| 3174 | 3188 | $field .= $this->render_input_field( 'tel', $id, $value, $class, $placeholder, $required ); |
| 3175 | 3189 | return $field; |
| 3176 | 3190 | } |
| 3177 | 3191 | |
| 3192 | + /** |
|
| 3193 | + * @param string $class |
|
| 3194 | + * @param string $placeholder |
|
| 3195 | + */ |
|
| 3178 | 3196 | function render_url_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3179 | 3197 | $field = $this->render_label( 'telephone', $id, $label, $required, $required_field_text ); |
| 3180 | 3198 | $field .= $this->render_input_field( 'tel', $id, $value, $class, $placeholder, $required ); |
| 3181 | 3199 | return $field; |
| 3182 | 3200 | } |
| 3183 | 3201 | |
| 3202 | + /** |
|
| 3203 | + * @param string $class |
|
| 3204 | + * @param string $placeholder |
|
| 3205 | + */ |
|
| 3184 | 3206 | function render_textarea_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3185 | 3207 | $field = $this->render_label( 'textarea', $id, $label, $required, $required_field_text ); |
| 3186 | 3208 | $field .= "<textarea |
@@ -3195,6 +3217,9 @@ discard block |
||
| 3195 | 3217 | return $field; |
| 3196 | 3218 | } |
| 3197 | 3219 | |
| 3220 | + /** |
|
| 3221 | + * @param string $class |
|
| 3222 | + */ |
|
| 3198 | 3223 | function render_radio_field( $id, $label, $value, $class, $required, $required_field_text ) { |
| 3199 | 3224 | |
| 3200 | 3225 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
@@ -3217,6 +3242,9 @@ discard block |
||
| 3217 | 3242 | return $field; |
| 3218 | 3243 | } |
| 3219 | 3244 | |
| 3245 | + /** |
|
| 3246 | + * @param string $class |
|
| 3247 | + */ |
|
| 3220 | 3248 | function render_checkbox_field( $id, $label, $value, $class, $required, $required_field_text ) { |
| 3221 | 3249 | $field = "<label class='grunion-field-label checkbox" . ( $this->is_error() ? ' form-error' : '' ) . "'>"; |
| 3222 | 3250 | $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"; |
@@ -3226,6 +3254,9 @@ discard block |
||
| 3226 | 3254 | return $field; |
| 3227 | 3255 | } |
| 3228 | 3256 | |
| 3257 | + /** |
|
| 3258 | + * @param string $class |
|
| 3259 | + */ |
|
| 3229 | 3260 | function render_checkbox_multiple_field( $id, $label, $value, $class, $required, $required_field_text ) { |
| 3230 | 3261 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
| 3231 | 3262 | foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
@@ -3241,6 +3272,9 @@ discard block |
||
| 3241 | 3272 | return $field; |
| 3242 | 3273 | } |
| 3243 | 3274 | |
| 3275 | + /** |
|
| 3276 | + * @param string $class |
|
| 3277 | + */ |
|
| 3244 | 3278 | function render_select_field( $id, $label, $value, $class, $required, $required_field_text ) { |
| 3245 | 3279 | $field = $this->render_label( 'select', $id, $label, $required, $required_field_text ); |
| 3246 | 3280 | $field .= "\t<select name='" . esc_attr( $id ) . "' id='" . esc_attr( $id ) . "' " . $class . ( $required ? "required aria-required='true'" : '' ) . ">\n"; |
@@ -3258,6 +3292,10 @@ discard block |
||
| 3258 | 3292 | return $field; |
| 3259 | 3293 | } |
| 3260 | 3294 | |
| 3295 | + /** |
|
| 3296 | + * @param string $class |
|
| 3297 | + * @param string $placeholder |
|
| 3298 | + */ |
|
| 3261 | 3299 | function render_date_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3262 | 3300 | $field = $this->render_label( 'date', $id, $label, $required, $required_field_text ); |
| 3263 | 3301 | $field .= $this->render_input_field( 'text', $id, $value, $class, $placeholder, $required ); |
@@ -3277,6 +3315,10 @@ discard block |
||
| 3277 | 3315 | return $field; |
| 3278 | 3316 | } |
| 3279 | 3317 | |
| 3318 | + /** |
|
| 3319 | + * @param string $class |
|
| 3320 | + * @param string $placeholder |
|
| 3321 | + */ |
|
| 3280 | 3322 | function render_default_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder, $type ) { |
| 3281 | 3323 | $field = $this->render_label( $type, $id, $label, $required, $required_field_text ); |
| 3282 | 3324 | $field .= $this->render_input_field( 'text', $id, $value, $class, $placeholder, $required ); |