• Resolved markohoza

    (@markohoza)


    Hi.

    After the last update in 5.7.5.1, the “shortcode_atts_wpcf7” filter stopped working. Do you know where the problem is?

    Form:

    [hidden offer default:shortcode_attr]

    functions.php:

    // Contactform7: shortcodes
    add_filter('shortcode_atts_wpcf7', 'maus_shortcode_atts_wpcf7_filter', 10, 3);
    function maus_shortcode_atts_wpcf7_filter( $out, $pairs, $atts ) {
        if( isset($atts['offer']) ) $out['offer'] = $atts['offer'];
        return $out;
    }

    single.php:

    [contact-form-7 title="Dopytový formulár: ponuka" html_id="form-demand" offer="XYZ"]

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Since CF7 5.7.5 and 5.7.5.1, it seems like you are required to specify the form ID in your shortcode. Previously it worked fine with only the title.

    So, update your shortcode like this (change 123 to your form ID):

    [contact-form-7 id="123" title="Dopytový formulár: ponuka" html_id="form-demand" offer="XYZ"]
    Thread Starter markohoza

    (@markohoza)

    Thanks!
    Adding the form id to the shortcode helped.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘shortcode not working’ is closed to new replies.