Support » Plugin: Contact Form 7 » array of attributes for Shortcode Attributes

  • Resolved MVertruger

    (@vmercader)


    Hello, on this page /getting-default-values-from-shortcode-attributes/

    can you use array to assign multiple attributes?

    add_filter( 'shortcode_atts_wpcf7', 'custom_shortcode_atts_wpcf7_filter', 10, 3 );
    function custom_shortcode_atts_wpcf7_filter( $out, $pairs, $atts ) {
        $my_attr = array('attr1','attr2');
        if ( isset( $atts[$my_attr] ) ) {
            $out[$my_attr] = $atts[$my_attr];
        }
        return $out;
    }

    Something like that?

    • This topic was modified 2 years, 3 months ago by MVertruger.

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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘array of attributes for Shortcode Attributes’ is closed to new replies.