WordPress add_filter(the_content,'func') 无法按预期工作



我使用add_filter(the_content,'func')将[一些单词]添加到内容中。

the_content()运行时,[一些单词]没有显示在内容中。

但是,如果在调用the_content()之前echovad_dump某些内容,将显示[一些单词]。

 func($content) {
    return $content.'[some words]';
}

试试这个

add_filter('the_content','func');
function func(){
  return $content.'[some words]';
}

您忘了在the_content的开头和结尾添加'

最新更新