【发布时间】:2011-12-07 10:49:42
【问题描述】:
我在这里找到了这篇关于如何在 wordpress 中取消注册样式的文章。 techotronic.de/how-to-de-register-style-sheet-wordpress/
我认为很简单,但我无法理解他想说的话。这是下面的代码...
add_action( 'wp_print_styles', 'custom_deregister_styles', 100 );
function custom_deregister_styles() {
wp_deregister_style( 'colorbox-theme1' );
}
直截了当,对于他的插件...
但是如果我想从我正在使用的另一个插件中注销一个样式,你如何找出在代码中输入的名称 - wp_deregister_style(' ???? ');
我已经尝试了显而易见的样式表名称...
add_action( 'wp_print_styles', 'custom_deregister_styles', 100 );
function custom_deregister_styles() {
wp_deregister_style( 'language-selector.css' );
}
这是我找到的另一种方法,但无法理解我要做什么?
add_action("gform_enqueue_scripts", "deregister_style");
function deregister_style(){
wp_deregister_style("gforms_css");
}
这个注销方法是如何工作的,我需要在插件中寻找什么来获取相对名称才能让它工作。我很困惑。
感谢任何建议,谢谢!
更新
我刚刚发现我试图取消注册的样式表不是通过 wp_enqueue_style 或 wp_register_style 加载的。
在此处查看插件中的 php 文件 https://gist.github.com/1442470
在 792 行查找 language-selector.css
【问题讨论】:
标签: wordpress stylesheet