S
S
skdon2016-01-14 21:16:30
WordPress
skdon, 2016-01-14 21:16:30

wp_deregister_script not working, why?

Good afternoon!
Please tell me why wp_deregister_script does not work in this example.
Find the name of the included library in the plugin file

wp_enqueue_script( 'pointer_script', plugins_url( '/media/js/pointer.js', __FILE__ ), array( 'jQuery') );

Next in the function I write the code
add_action( 'wp_enqueue_scripts', 'my_deregister_javascript');
function my_deregister_javascript() {
    wp_deregister_script( 'pointer_script' );
    wp_deregister_script( 'dsq_count_script' );
}

In theory, the pointer_script script should be disabled on all pages.
But he remains connected.
Tell me where the "dog is buried"

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mr Crabbz, 2016-01-14
@skdon

So most likely the pointer_script script call does not hang on the wp_enqueue_scripts hook. Look in the plugin file for which hook the connection is implemented in.

W
WP Panda, 2016-01-15
@wppanda5

Because the discus plugin is extremely handwritten
https://github.com/disqus/disqus-wordpress/blob/ma...

H
HAbRAhabp, 2016-01-14
@HAbRAhabp

Try an eventafter_setup_theme

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question