first commit

This commit is contained in:
Rachit Bhargava
2023-07-21 17:12:10 -04:00
parent d0fe47dde4
commit 5d0f0734d8
14003 changed files with 2829464 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
add_action( 'wpcf7_init', 'wpcf7_add_form_tag_hidden', 10, 0 );
function wpcf7_add_form_tag_hidden() {
wpcf7_add_form_tag( 'hidden',
'wpcf7_hidden_form_tag_handler',
array(
'name-attr' => true,
'display-hidden' => true,
)
);
}
function wpcf7_hidden_form_tag_handler( $tag ) {
if ( empty( $tag->name ) ) {
return '';
}
$atts = array();
$class = wpcf7_form_controls_class( $tag->type );
$atts['class'] = $tag->get_class_option( $class );
$atts['id'] = $tag->get_id_option();
$value = (string) reset( $tag->values );
$value = $tag->get_default_option( $value );
$atts['value'] = $value;
$atts['type'] = 'hidden';
$atts['name'] = $tag->name;
$atts = wpcf7_format_atts( $atts );
$html = sprintf( '<input %s />', $atts );
return $html;
}