/**
*WordPress add_action() 和 add_filter() 挂载类函数
*https://www.weixiaoduo.com/hook-object-function/
*/
classBing_obj{
function__construct(){
add_action('wp_head',array($this,'head'));
add_filter('the_content',array($this,'content'));
}
functionhead(){
echo'<meta charset="UTF-8">';
}
functionfooter(){
echo'薇晓朵 版权所有';
}
functioncontent($content){
returntrim($content);
}
}
$obj=newBing_obj;
add_action('wp_footer',array($obj,'footer'));