wordpress修改后台管理菜单名称

WordPress后台管理菜单名称修改的方法与代码如下:只需要将下列代码放到主题的functions.php里面就可以。

//change post name
function change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = ‘产品与文章’;
$submenu[‘edit.php’][5][0] = ‘产品与文章’;
$submenu[‘edit.php’][10][0] = ‘添加产品与文章’;
$submenu[‘edit.php’][15][0] = ‘产品与文章分类’; // Change name for categories
$submenu[‘edit.php’][16][0] = ‘标签’; // Change name for tags
echo ”;
}

function change_post_object_label() {
global $wp_post_types;
$labels = &$wp_post_types[‘post’]->labels;
$labels->name = ‘产品与文章’;
$labels->singular_name = ‘产品与文章’;
$labels->add_new = ‘添加产品与文章’;
$labels->add_new_item = ‘添加产品与文章’;
$labels->edit_item = ‘编辑产品与文章’;
$labels->new_item = ‘产品与文章’;
$labels->view_item = ‘查看产品与文章’;
$labels->search_items = ‘搜索产品与文章’;
$labels->not_found = ‘没有搜索结果’;
$labels->not_found_in_trash = ‘没有结果’;
}
add_action( ‘init’, ‘change_post_object_label’ );
add_action( ‘admin_menu’, ‘change_post_menu_label’ );
//change post name

滚动至顶部