5ucms论坛
标题:
the_title 过滤器 文章标题
[打印本页]
作者:
admin
时间:
2021-6-5 07:36
标题:
the_title 过滤器 文章标题
function test($title,$id=null){
if(in_category('news',$id)){ //如果这个id属于名为newsr的分类
return '';
}
return $title;
}
//为the_title过滤器挂载test方法,优先级10,这个test方法有2个参数
add_filter('the_title','test',10,2)
复制代码
欢迎光临 5ucms论坛 (http://bbs.5ucms.com/)
Powered by Discuz! X3.2