admin管理员组文章数量:1278986
When editing a lot of pages at once, it would be helpful to change the default "Edit page < sitename - Wordpress" to something more clear, like the page/post title.
I found a few code snippets, like the one below, that doesn't work, I just get an empty page title.
Using WordPress 5.8.2 and have the code infunctions.php.
add_filter('admin_title', 'better_admin_title', 10, 2);
function better_admin_title($admin_title, $title)
{
global $post, $title, $action, $current_screen;
if (is_admin() and $action == 'edit' and in_array($current_screen->id, ['post', 'page'])) {
return $title . ' ‹ ' . $post->post_title . ' — ' . get_bloginfo('name');
}
return $admin_title;
}
本文标签: Change the default PostPage edit title in Admin
版权声明:本文标题:Change the default PostPage edit title in Admin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741216988a2360234.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论