• Resolved seanfranchise

    (@seanfranchise)


    I followed the instructions here:
    https://contactform7.com/2015/01/10/adding-a-custom-form-tag/

    Put the code in functions.php:

    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 ) {
        return date_i18n( get_option( 'time_format' ) );
    }

    And then added it to my form like so:

    
    <label> Name:</label>[text* full-name] 
    <label> City:</label>[text city] 
    <label> State:</label>[text state] 
    <label> Zip Code:</label>[text zip-code] 
    <label> Phone:</label>[text phone] 
    <label> Email:</label>[email* email] 
    <label> Comments: </label>[textarea* comments]
    [clock]
    [submit "SUBMIT"]
    

    But I don’t get a clock, I get just “[clock]” on the page the form is put into?

    If it makes a difference, the form is inserted into a theme template with the shortcode.
    I am running the latest contact form 7 version available to me at this time ( 5.0 )
    And my wordpress version is fairly recent as well, not the most recent but within a few version numbers.

    Thanks for any help!
    Also, while I have the chance, thank you for the plugin! I use it all the time.
    I’m excited to be able to customize it even further with this feature.

    – Sean

    • This topic was modified 8 years, 4 months ago by seanfranchise.
Viewing 1 replies (of 1 total)
  • Thread Starter seanfranchise

    (@seanfranchise)

    This can be safely deleted or whatever, as it does not add to anything constructively.
    The problem was my functions.php file was not being saved over FTP for whatever reason, even though it said it was. Reconnecting solved the issue.

Viewing 1 replies (of 1 total)

The topic ‘Custom Tag/Field not working?’ is closed to new replies.