最近访客
百度未收录

删除后台标题中的WordPress后缀

删除后台标题中的WordPress后缀-狐狸库

WordPress后台标题(title)默认后缀显示-WordPress,如果想隐藏这个后缀,可以将下面代码添加到当前主题functions.php中,即可删除这个后缀:

去除后台标题中的“- WordPress”

// 去除后台标题中的“—— WordPress”
add_filter(\'admin_title\', \'zm_custom_admin_title\', 10, 2);
function zm_custom_admin_title($admin_title, $title){
    return $title.\' ‹ \'.get_bloginfo(\'name\');
}

去除登录标题中的“- WordPress”

// 隐藏后台标题中的“WordPress”
add_filter(\'login_title\', \'zm_custom_login_title\', 10, 2);
    function zm_custom_login_title($login_title, $title){
        return $title.\' ‹ \'.get_bloginfo(\'name\');
}

附:隐藏后台其它明显与WordPress相关的字样和图标

隐藏后台左上角WordPress标志

// 隐藏左上角WordPress标志
function hidden_admin_bar_remove() {
    global $wp_admin_bar;
        $wp_admin_bar->remove_menu(\'wp-logo\');
}
add_action(\'wp_before_admin_bar_render\', \'hidden_admin_bar_remove\', 0);

屏蔽后台页脚WordPress版本信息

// 屏蔽后台页脚WordPress版本信息
function change_footer_admin () {return \'\';}
add_filter(\'admin_footer_text\', \'change_footer_admin\', 9999);
function change_footer_version() {return \'\';}
add_filter( \'update_footer\', \'change_footer_version\', 9999);

移除WordPress仪表盘中的项目

function remove_dashboard_meta() {
    remove_meta_box( \'dashboard_incoming_links\', \'dashboard\', \'normal\' );
    remove_meta_box( \'dashboard_plugins\', \'dashboard\', \'normal\' );
    remove_meta_box( \'dashboard_primary\', \'dashboard\', \'side\' );
    remove_meta_box( \'dashboard_secondary\', \'dashboard\', \'normal\' );
    remove_meta_box( \'dashboard_quick_press\', \'dashboard\', \'side\' );
    remove_meta_box( \'dashboard_recent_drafts\', \'dashboard\', \'side\' );
    remove_meta_box( \'dashboard_recent_comments\', \'dashboard\', \'normal\' );
    remove_meta_box( \'dashboard_right_now\', \'dashboard\', \'normal\' );
    remove_meta_box( \'dashboard_activity\', \'dashboard\', \'normal\');//since 3.8
}
add_action( \'admin_init\', \'remove_dashboard_meta\' );
温馨提示:本文最后更新于2022/10/20 04:14:51。若文章内容或图片失效,请留言联系站长反馈!
!
也想出现在这里? 联系我们
创意广告
© 版权声明
THE END
点赞0赞赏 分享
评论 抢沙发

请登录后发表评论

    请登录后查看评论内容