以下代码加到functions.php文件的底部
- //屏蔽gravatar,调用多说缓存图片
function duoshuo_avatar($avatar) {
$avatar = str_replace(array("www.gravatar.com","0.gravatar.com","1.gravatar.com","2.gravatar.com"),"gravatar.duoshuo.com",$avatar);
return $avatar;
}
add_filter( 'get_avatar', 'duoshuo_avatar', 10, 3 );
- //屏蔽谷歌文字
function coolwp_remove_open_sans_from_wp_core() {
wp_deregister_style( 'open-sans' );
wp_register_style( 'open-sans', false );
wp_enqueue_style('open-sans','');
}
add_action( 'init', 'coolwp_remove_open_sans_from_wp_core' );
另外这是禁用反人类编辑器和链接栏的代码
- //友情链接菜单显示
add_filter( 'pre_option_link_manager_enabled', '__return_true' );
- //禁用新编辑器,启用经典编辑器
add_filter('use_block_editor_for_post', '__return_false');