How to disable a jQuery plugin on WordPress plugin page

admin2025-06-06  0

I have created a WordPress search plugin for a customer. It worked at my site, but when I installed it in my customer's website it broke, because there is a jquery.formstyller plugin installed there, which apparently styled the dropdown I used in the plugin with it's own divs and styles.

Is there a way I can turn off that plugin when the user lands on the plugin page for searching?

I have created a WordPress search plugin for a customer. It worked at my site, but when I installed it in my customer's website it broke, because there is a jquery.formstyller plugin installed there, which apparently styled the dropdown I used in the plugin with it's own divs and styles.

Is there a way I can turn off that plugin when the user lands on the plugin page for searching?

Share Improve this question edited Nov 2, 2018 at 11:21 Krzysiek Dróżdż 25.6k9 gold badges53 silver badges74 bronze badges asked Nov 2, 2018 at 7:37 mazttmaztt 1056 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Sure there is.

https://codex.wordpress/Function_Reference/wp_dequeue_script

/**
 * Dequeue the jQuery UI script.
 *
 * Hooked to the wp_print_scripts action, with a late priority (100),
 * so that it is after the script was enqueued.
 */
function wpdocs_dequeue_script() {
   wp_dequeue_script( 'jquery-ui-core' );
}
add_action( 'wp_print_scripts', 'wpdocs_dequeue_script', 100 );

Obviously replace jquery-ui-core with the handler of the script you want to remove. And don't do this globaly, only for your plugin page, where conflict happens.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749211888a317299.html

最新回复(0)