| @@ -35,8 +35,13 @@ | ||
| 35 | 35 | if ( empty( $attributes ) ) { |
| 36 | 36 | return ''; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + // Load the Inputmask library only when this field uses an input pattern. | |
| 40 | + if ( ! empty( $attributes['inputMask'] ) && 'none' !== $attributes['inputMask'] ) { | |
| 41 | + wp_enqueue_script( 'suredonation-inputmask' ); | |
| 42 | + } | |
| 43 | + | |
| 39 | 44 | $markup_class = new Input_Markup( $attributes ); |
| 40 | 45 | ob_start(); |
| 41 | 46 | echo wp_kses( $markup_class->markup(), self::get_allowed_form_html() ); |
| 42 | 47 | $output = ob_get_clean(); |