Plugin Author
MihChe
(@mihche)
Hi ganch0,
If you want WPBruiser to run only on specific pages, you can have something like this into your theme functions.php file
function deregister_wpbruiser_scripts() {
if( is_page( array(page_id) ) )
return;
wp_dequeue_script( 'wp-bruiser-public-script' );
wp_deregister_script( 'wp-bruiser-public-script' );
}
add_action( 'wp_print_scripts', 'deregister_wpbruiser_scripts' );
Please replace the array values with your particular pages’ ID OR SLUG OR TITLE (it is up to you) where you want WPBruiser to protect your forms.
Let’s say you have 2 pages where WPBruiser should protect some forms
Page 1 – slug is my-contact-1 and ID is 123
Page 2 – slug is my-contact-2 and ID is 234
The IF condition can look like
if( is_page( array(123, 234) ) )
OR
if( is_page( array('my-contact-1', 'my-contact-2') ) )
OR
if( is_page( array(123, 'my-contact-2') ) )
OR
if( is_page( array('my-contact-1', 234) ) )
Let me know if this works for you
Mihai
Plugin Author
MihChe
(@mihche)
Hi,
Glad to hear it works for you!
If you’re happy with my plugin I’ll really appreciate if you write a short review.
Cheers,
Mihai
What about if I just want to exclude the homepage, but have it running on just my contact page, and all blog posts ?
Thanks
Hi 🙂 Sorry to update an old post, but can you explain how can I exclude homepage to prevent loading files of this plugin?
Thanks