最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - Replace "WordPress" word in title of Dashboard

programmeradmin1浏览0评论

I would like to replace the WordPress word in title of Dashboard.

Original title:

Dashboard < Site Title - WordPress

Expected result:

Dashboard < Site Title - foobar

I tried to do this with this below code, but it doesn't do what I expected.

add_filter('admin_title', 'my_admin_title', 10, 2);
function my_admin_title($admin_title, $title)
{
        return get_bloginfo('name').' &bull; '.$title;
}

I would like to replace the WordPress word in title of Dashboard.

Original title:

Dashboard < Site Title - WordPress

Expected result:

Dashboard < Site Title - foobar

I tried to do this with this below code, but it doesn't do what I expected.

add_filter('admin_title', 'my_admin_title', 10, 2);
function my_admin_title($admin_title, $title)
{
        return get_bloginfo('name').' &bull; '.$title;
}
Share Improve this question asked Nov 16, 2019 at 9:50 FerimanFeriman 2892 silver badges9 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 2

You've tried correct filter - just needs to update return:

function my_admin_title ( $admin_title, $title ) {
    return $title . ' ‹ ' . get_bloginfo( 'name' ) . ' — ' . 'foobar';
}
add_filter( 'admin_title', 'my_admin_title', 10, 2 );

Btw, filter above works only for logged pages, for login page needs to add another filter:

add_filter( 'login_title', 'my_admin_title', 10, 2 );

If you're talking about this area

!Wordpress Title]1

/wp-admin/options-general.php

You should not have to insert in PHP

发布评论

评论列表(0)

  1. 暂无评论