如何将大板上所有的“帖子”文本都变成“文章”?

时间:2014-10-05 作者:Leader

如何更改wp管理/仪表板中的所有“帖子”文本,并将其更改为“文章”?

1 个回复
最合适的回答,由SO网友:nothingtosee 整理而成

可以更新替代贴子标签:

function wpse163462_rename_menu_post_to_article() {
    global $menu;
    global $submenu;
    $menu[5][0] = \'Articles\';
    $submenu[\'edit.php\'][5][0] = \'Articles\';
    $submenu[\'edit.php\'][10][0] = \'Add Articles\';
    echo \'\';
}
function wpse163462_rename_post_to_article() {
        global $wp_post_types;
        $labels = &$wp_post_types[\'post\']->labels;
        $labels->name = \'Articles\';
        $labels->singular_name = \'Article\';
        $labels->add_new = \'Add Article\';
        $labels->add_new_item = \'Add Article\';
        $labels->edit_item = \'Edit Article\';
        $labels->new_item = \'Article\';
        $labels->view_item = \'View Article\';
        $labels->search_items = \'Search Articles\';
        $labels->not_found = \'No Articles found\';
        $labels->not_found_in_trash = \'No Articles found in Trash\';
}
add_action( \'init\', \'wpse163462_rename_post_to_article\' );
add_action( \'admin_menu\', \'wpse163462_rename_menu_post_to_article\' );

结束

相关推荐

有没有可能通过ADMIN_ENQUEUE_SCRIPT使页面/帖子更具针对性?

我正在使用此代码在管理员中加载样式表,但仅在post中加载。php相关页面:function my_enqueue_for_post_pages_only($hook) { if( \'post.php\' != $hook ) return; wp_register_style( \'custom_wp_admin_css_for_post_pages_only\', get_template_directory_uri() . \'/style_