【问题标题】:How to rename "Author" label in the WP-admin UI如何在 WP-admin UI 中重命名“作者”标签
【发布时间】:2018-04-18 18:27:29
【问题描述】:

查看下面的截图;我要做的就是为所有可以访问后端的用户重命名“作者”。如果是全球性的变化会更好。

【问题讨论】:

    标签: wordpress wordpress-theming custom-wordpress-pages wp-admin


    【解决方案1】:

    您可以使用manage_edit-post_columns 过滤器,因此将以下代码添加到您的functions.php 文件中:

    add_filter( 'manage_edit-post_columns', 'rename_author_column' );
    function rename_author_column( $columns ) {
        $columns['author'] = 'Posted by';
        return $columns;
    }
    

    更新:

    要在单个帖子编辑中更改作者元框的标题,请将此代码添加到您的functions.php

    add_action('add_meta_boxes', 'change_author_metabox');
    function change_author_metabox() {
        global $wp_meta_boxes;
        $wp_meta_boxes['post']['normal']['core']['authordiv']['title']= 'Posted by';
    }
    

    【讨论】:

    • 非常感谢!!!!!!这样可行!另外,当你编辑里面的帖子时,你能帮我“作者”的显示名称吗?(localhost/wordpress/wp-admin/post.php?post=10&action=edit)。
    • 我上传了另一个截图。
    • 太棒了!非常感谢!顺便说一句,你有任何改变 wp 后端的建议教程吗?
    • 如果我们只想针对特定的帖子类型执行此操作怎么办?
    猜你喜欢
    • 1970-01-01
    • 2019-03-10
    • 2012-08-16
    • 1970-01-01
    • 1970-01-01
    • 2010-11-04
    • 1970-01-01
    • 1970-01-01
    • 2018-10-04
    相关资源
    最近更新 更多