lopeax
Forum Replies Created
-
Hey Garrett,
No problem, I like functions being as complete and dynamic as possible. Thank for updating it!
Cheers
Hello Garret,
Thanks for posting that. However there is a minor error. Through a little testing I found that the o1 at the end of the I’d actually differentiates forms if there are more than one of the same form on the same page, th is is why I left it out of my initial function. But it’s a minor thing as in almost every case the same form won’t be used more than once on a page.
Cheers
Hey there! I’ve encountered this problem as well, but didn’t like how undynamic the solution was (required knowledge of the id, so it wouldn’t work with the advanced custom fields addon for contact form 7), below is a short example of the code I did to make this more dynamic (though I’m sure it can be more optimised, but I needed a quick fix for this).
$afterid = explode('id="wpcf7-f', $formshortcode); $formid = explode('-',$afterid[1],2); $form = str_replace( 'wpcf7-f'.$formid[0], 'wpcf7-f'.$formid[0].'-p'.get_the_id(), $formshortcode );Where $formshortcode is either the shortcode of the form, OR, the output of the shortcode.