Hi, I was actually having the same trouble as you and found your post through a Google search. I actually found the cause of my problem and hope it helps you. I looked at the source code for the invalidate function and I found this:
$name = ! empty( $tag ) ? $tag->name : null;
if ( empty( $name ) || ! wpcf7_is_name( $name ) ) {
return;
}
In my case, I didn’t use a name for my custom tag. So as you can see in the code, not having a name causes the function to short-circuit. So you need to pass in a name in the shortcode and you have to set the third parameter of wpcf7_add_shortcode to true (wpcf7_add_form_tag in Contact Form 7 4.6+)
-
This reply was modified 9 years, 1 month ago by kodos84.
-
This reply was modified 9 years, 1 month ago by kodos84.