• Good day. Update CF7 to v4.8 and Special Mail Tags like [_post_title] stop working. Send to email just short-code. Is it a bug or will be a new short-code for [_post*]?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Thread Starter bigny

    (@bigny)

    Yes i read it, but then i pasty CF7 in PHP by do short code in CF v4.7 all work well.
    working code on v4.7
    function fix_wpcf7_do_shortcode( $shortcode, $id = NULL ) {
    if ( ! isset( $id ) ) {
    $id = get_the_ID();
    }
    $regex_pattern = get_shortcode_regex();
    preg_match( ‘/’ . $regex_pattern . ‘/s’, $shortcode, $regex_matches );
    $shortcode_atts = shortcode_parse_atts( $regex_matches[3] );
    $shortcode_id = $shortcode_atts[‘id’];

    return str_replace( ‘wpcf7-f’ . $shortcode_id . ‘-o’, ‘wpcf7-f’ . $shortcode_id . ‘-p’ . $id . ‘-o’, do_shortcode( $shortcode ) );
    }

    <?php echo fix_wpcf7_do_shortcode( ‘[contact-form-7 id=”90″ title=”Find apartment”]’, get_the_ID() ); ?>

    or

    <?php echo do_shortcode( ‘[contact-form-7 id=”90″ title=”Find apartment”]’); ?>

    Hi,
    I have similar problem.

    After updating CF7 from 4.7 to 4.8, special tags in emails stopped working.
    Instead New submission from My super post it would show New submission from [_post_title]

    Edit:
    Figured it out.
    There is this new condition which checks whether the form is inside WP Loop.
    I wasn’t using WP Loop on my custom single.php pages, so I added it and it is working now!

    bigamist

    (@bigamist)

    Hi,

    I have exactly same problem. I have a Form in the Portfolio and I need to use [_post_name] to know from wich item of the Portfolio the client is asking for Information.

    The behavior of the email is exactly as you describe: New submission from My super post it would show New submission from [_post_title]

    You said that you figured it out. Please tell me how I can use the WP Loop in all my Portfolio pages.

    Thanks & Best Regards
    Joao

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Special Mail Tags’ is closed to new replies.