admin管理员组文章数量:1130349
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 badges1 Answer
Reset to default 1Sure 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.
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 badges1 Answer
Reset to default 1Sure 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.
本文标签: How to disable a jQuery plugin on WordPress plugin page
版权声明:本文标题:How to disable a jQuery plugin on WordPress plugin page 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749211858a2333497.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论