How to dequeue styles and scripts for this plugin?
-
I appreciate the plugin, but I only need it to run on one page. However, I see the styles/scripts run on all pages. I typically dequeue styles/scripts by using the following function, but it’s not working to dequeue this plugin.
Can you please advise how to accomplish that please? Thanks so much.
function cf_turnstile_dequeue_scripts() { if( ! is_page( '123456' ) ) { wp_deregister_script( 'cfturnstile' ); wp_dequeue_script( 'cfturnstile' ); wp_deregister_style( 'cfturnstile-css' ); wp_dequeue_style( 'cfturnstile-css' ); } } add_action( 'wp_print_scripts', 'cf_turnstile_dequeue_scripts', 100 ); add_action( 'wp_print_styles', 'cf_turnstile_dequeue_scripts', 100 );
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘How to dequeue styles and scripts for this plugin?’ is closed to new replies.