deregister_styles
-
Hi Tobias, I’m trying to deregister the CSS from TablePress in every pages but the one which uses it.
The code I’m looking for will be similar to this:
add_action( 'wp_print_styles', 'cf7_deregister_styles', 100 ); function cf7_deregister_styles() { if ( ! is_page( 'contacto' ) ) { wp_deregister_style( 'contact-form-7' ); } } add_action( 'wp_print_scripts', 'cf7_deregister_javascript', 100 ); function cf7_deregister_javascript() { if ( ! is_page( 'contacto' ) ) { wp_deregister_script( 'contact-form-7' ); } }
(in the above case, I deregister both CSS and Js for Contact Form 7 plugin.)
I’m willing to do the same with your plugin with a different page (/lista-de-precios), but the only filter I’ve found in the forum is
add_filter( 'tablepress_use_default_css', '__return_false' );
How can introduce a function which in my “if block” which unloads the Js and CSS of your plugin.
Thank you in advance. Your plugin is excellent.
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘deregister_styles’ is closed to new replies.