我需要将过滤器添加到特定的 wordpress 函数,该函数在可插入函数主题的函数 f 包含的文件中定义
函数.php:
if (!function_exists('nectar_colors_css_output')) {
function nectar_colors_css_output(){
include('css/colors.php');
}
}
颜色.php:
<?php
function nectar_colors() {
// not relevant what happens here, but I have
// to call another function before this one is called!
}
?>
我使用了一个子主题,当我尝试从子主题的functions.php中过滤这个函数时,什么也没有发生。这是因为父主题的可插拔函数会在子主题调用过滤器之后被调用。
我在子主题的functions.php中的过滤功能是
function filter_function() {
// some custom actions...
}
add_filter('nectar_colors', 'filter_function');
我怎样才能让这个过滤器工作?