Filter for excluding footer script on page
-
I have code that disables the CF7 resources, including reCAPTCHA, on pages that don’t contain any forms. However, the footer script is still included on those pages, and I’d like to stop this from happening.
In a
wp_enqueue_scripts
action, I have this code, but it doesn’t work:if ( class_exists( 'ABCF7_captcha' ) ) { remove_action( 'wp_footer', array( 'ABCF7_captcha', 'ABCF7_footer_script' ), 100 ); }
A simpler way would be to provide a filter, which defaults to
true
, and determines whether the footer script should be loaded.Alternatively,
ABCF7_remove_google_captcha_js()
can check if any reCAPTCHA resources are enqueued and add the footer action, instead of adding it unconditionally duringinit
.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 ‘Filter for excluding footer script on page’ is closed to new replies.