• Hi, I have a problem with sequentional number ID in Contact Form 7. I have this code in functions.php, but it works like that:

    Code:

    
    //Define the key to store in the database
    define( 'CF7_COUNTER', 'cf7-counter' );
     
    //Create the shortcode which will set the value for the DTX field
    function cf7dtx_counter(){
        $val = get_option( CF7_COUNTER, 0) + 1;  //Increment the current count
        return $val;
    }
    add_shortcode('CF7_counter', 'cf7dtx_counter');
     
    //Action performed when the mail is actually sent by CF7
    function cf7dtx_increment_mail_counter(){
        $val = get_option( CF7_COUNTER, 0) + 1; //Increment the current count
        update_option(CF7_COUNTER, $val); //Update the settings with the new count
    }
    add_action('wpcf7_mail_sent', 'cf7dtx_increment_mail_counter');

    But is it working that in Contact Form 7 is for example 880331, but id thank you page is number +1, 880332.

    Do you know, where could be problem?

    Thanks a lot

    Michal

    The page I need help with: [log in to see the link]

  • The topic ‘Sequentional ID’ is closed to new replies.