|
Server IP : 10.131.40.8 / Your IP : 216.73.216.15 Web Server : Apache System : Linux webd008.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : ludmqhh ( 137773) PHP Version : 8.4.10 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/ludmqhh/www/guillaume/wp-content/plugins/akismet/../contact-form-7/modules/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?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;
}
