Answer the question
In order to leave comments, you need to log in
How to properly disable plugin js files?
Let's say on a certain page I want the js of the plugin not to be loaded on the page
, I write:
function exclude_js() {
if( is_single() ){
wp_deregister_script('crayon_js');
}
}
add_action('wp_print_scripts', 'exclude_js', 100);
Answer the question
In order to leave comments, you need to log in
In addition to wp_deregister_script, you also need to do wp_dequeue_script.
I don’t know how in WP, but usually they include the necessary files. And do not turn off unnecessary ones .
The task of the typesetter is to lay out the skeleton. Think for yourself what can be implemented on the client side, that is - your task. Sorting, for example, can be implemented using JS, but again, depending on what the server gave us. Comments are up to the programmer. Writing, reading and storing data is the task of the back-end developer. Rendering comments from the client side is up to you.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question