我正在创建一个插件。许多主题显示摘录,例如is_search() 是1.
我希望WordPress无论如何都能显示全部内容。
我该怎么做?
我应该使用add_filter (\'the_excerpt\', \'mycontentfunction\' );
我应该使用add_filter 或apply_filters?
最合适的回答,由SO网友:Manny Fleurmond 整理而成
下面的代码应该可以做到这一点。它接受摘录过滤器并返回内容。
function wpse189347_excerpt( $excerpt ){
return get_the_content();
}
add_filter( \'the_excerpt\', \'wpse189347_excerpt\', 10, 1 );