找到了我的答案,包括我的完整解决方案:
<?php
/*
Plugin Name: Rename Posts to News
Description: Rename built in posts to be called News
Version: 1.0
Author: Scott Cariss @ Philosophy Design
Author URI: http://www.philosophydesign.com
*/
// Not a WordPress context? Stop.
! defined( \'ABSPATH\' ) and exit;
add_action( \'init\', array ( \'chg_Posts_to_News\', \'init\' ) );
add_action( \'admin_menu\', array ( \'chg_Posts_to_News\', \'admin_menu\' ) );
class chg_Posts_to_News
{
public static function init()
{
global $wp_post_types;
$labels = &$wp_post_types[\'post\']->labels;
$labels->name = \'Corporate News\';
$labels->singular_name = \'Corporate News\';
$labels->add_new = \'Add Corporate News\';
$labels->add_new_item = \'Add Corporate News\';
$labels->edit_item = \'Edit Corporate News\';
$labels->new_item = \'Corporate News\';
$labels->view_item = \'View Corporate News\';
$labels->search_items = \'Search Corporate News\';
$labels->not_found = \'No corporate news found\';
$labels->not_found_in_trash = \'No corporate news found in trash\';
$labels->name_admin_bar = \'Corporate News\';
}
public static function admin_menu()
{
global $menu;
global $submenu;
$menu[5][0] = \'Corporate News\';
$submenu[\'edit.php\'][5][0] = \'Corporate News\';
$submenu[\'edit.php\'][10][0] = \'Add Corporate News\';
}
}
?>
只需要更改标签
$labels->name_admin_bar = \'Corporate News\';
查看函数wp_admin_bar_new_content_menu( $wp_admin_bar )
这涉及到放置这些下拉菜单项,那里没有允许我更改顺序的过滤器或挂钩,因此我只能假设如果没有一些JS黑客,它是不可行的。