Prevent footer action on pages without forms
-
My previous thread on this is now closed, but still no change to the plugin. Maybe that’s a good thing, because I’ve found a better way to do it ??
Please find out if CF7 resources are enqueued in
ABCF7_check_captcha_active()
and only process pages where that’s true. On my sites, I prevent CF7 resources from being enqueued under certain conditions, and it’s unnecessary to output your footer script on those pages.You can use one of these methods to check this:
wp_script_is( 'wpcf7-recaptcha' )
has_action( 'wp_enqueue_scripts', 'wpcf7_recaptcha_enqueue_scripts' )
- The topic ‘Prevent footer action on pages without forms’ is closed to new replies.