Problem with gutenburg
-
Here’s the code.
add_action( ‘wpcf7_init’, ‘custom_add_form_tag_clock’ );
function custom_add_form_tag_clock() {
wpcf7_add_form_tag(‘clock’,
‘custom_clock_form_tag_handler’); // “clock” is the type of the form-tag
}function custom_clock_form_tag_handler( $tag ) {
$name = $tag[‘name’];
echo $tag[‘name’];$current_agent = $_SERVER[‘HTTP_USER_AGENT’];
return ‘hi <input type=”hidden” name=”‘ . $tag[‘name’] . ‘” value=”‘ . $current_agent. ‘” />’;
}This works just fine.. But if I want to add a custom name using array( ‘name-attr’ => true ) then the editor refuses to save when the contact form 7 short code is used.. This is of course changing the line to wpcf7_add_form_tag(‘clock’,
‘custom_clock_form_tag_handler’, array( ‘name-attr’ => true )); I don’t know why it does this. But it’s frustrating trying to use wordpress 5.0.3. Solution? am I doing something wrong?
- The topic ‘Problem with gutenburg’ is closed to new replies.