true ) ); } /* * Form tag shortcode */ public function uacf7_dynamic_text_tag_handler_callback($tag){ if ( empty( $tag->name ) ) { return ''; } $validation_error = wpcf7_get_validation_error( $tag->name ); $class = wpcf7_form_controls_class( $tag->type ); if ( $validation_error ) { $class .= ' wpcf7-not-valid'; } $atts = array(); $atts['class'] = $tag->get_class_option( $class ); $atts['id'] = $tag->get_id_option(); $atts['tabindex'] = $tag->get_option( 'tabindex', 'signed_int', true ); if ( $tag->is_required() ) { $atts['aria-required'] = 'true'; } $atts['aria-invalid'] = $validation_error ? 'true' : 'false'; $atts['name'] = $tag->name; // input size $size = $tag->get_option( 'size', 'int', true ); if ( $size ) { $atts['size'] = $size; } else { $atts['size'] = 40; } // Visibility $visibility = $tag->get_option( 'visibility', '', true ); if($visibility == 'show'){ $atts['type'] = 'text'; }elseif($visibility == 'disabled'){ $atts['type'] = 'text'; $atts['disabled'] = 'disabled'; }elseif($visibility == 'hidden'){ $atts['type'] = 'hidden'; } $values = $tag->values; $key = $tag->get_option( 'key', '', true ); // Short Code $shortcode = ''; if(!empty($values)){ $shortcode = do_shortcode('['.$values[0].' attr="'.$key.'"]'); } $atts['value'] = esc_attr($shortcode); $atts = wpcf7_format_atts( $atts ); ob_start(); ?> > name; if ( isset( $_POST[$name] ) and is_array( $_POST[$name] ) ) { foreach ( $_POST[$name] as $key => $value ) { if ( '' === $value ) { unset( $_POST[$name][$key] ); } } } $empty = ! isset( $_POST[$name] ) || empty( $_POST[$name] ) && '0' !== $_POST[$name]; if ( $tag->is_required() and $empty ) { $result->invalidate( $tag, wpcf7_get_message( 'invalid_required' ) ); } return $result; } /* * Generate tag - conditional */ public function tag_generator() { if (! function_exists( 'wpcf7_add_tag_generator')) return; wpcf7_add_tag_generator('uacf7_dynamic_text', __('Dynamic Text', 'ultimate-addons-cf7'), 'uacf7-tg-pane-dynamic-text', array($this, 'tg_pane_uacf7_dynamic_text') ); } static function tg_pane_uacf7_dynamic_text( $contact_form, $args = '' ) { $args = wp_parse_args( $args, array() ); $uacf7_field_type = 'uacf7_dynamic_text'; ?>
documentation' ); ?>