• 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?

Viewing 1 replies (of 1 total)
  • This sounds similar to the problem I’m having since updated to WP 5.0.3 – any change to CF7, and Save goes to ‘page not found’ :-/

    Is CF7 using Gutenburg as the editor, for plain text?? It isn’t visible to me (maybe my Theme is too old), but the effect is the same, unable to Save.

    When I edit posts or pages, it will not Save iff I use the Classic editor, but does save when I use the Block editor.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with gutenburg’ is closed to new replies.