How can I add custom atts to contact form shortcode
[contact-form-7 id="108" title="Contact form 1" bg_color="red"]
// custom background
add_filter( 'wpcf7_form_elements','mycustom_wpcf7_form_elements');
function mycustom_wpcf7_form_elements( $form ) {
extract(shortcode_atts(array(
'id' => '',
'title' => '',
'bg_color' => ''
), $atts));
echo "<style> #{$id} { background : $bg_color } </style>";
$form = do_shortcode( $form );
return $form;
}
how should I do
if there is more than one form in one page
thanks before..