Quantcast
Channel: Lightningspirit's Blog
Viewing all articles
Browse latest Browse all 9

How to change admin menu Post labels to News

$
0
0

If you want to change the admin “Post” label to something more substantial, you can refer to this code and use it for your project:

function change_post_menu_label() {
	global $menu, $submenu;
	$menu[5][0] = __( 'News' );
	$submenu['edit.php'][5][0] = __( 'News' );
	$submenu['edit.php'][10][0] = __( 'Add News' );
}
add_action( 'admin_menu', 'change_post_menu_label' );
function change_post_object_label() {
	global $wp_post_types;
	$labels = &$wp_post_types['post']->labels;
	$labels->name = __( 'News' );
	$labels->singular_name = __( 'News' );
	$labels->add_new = __( 'Add News' );
	$labels->add_new_item = __( 'Add News' );
	$labels->edit_item = __( 'Edit News' );
	$labels->new_item = __( 'News' );
	$labels->view_item = __( 'View News' );
	$labels->search_items = __( 'Search News' );
	$labels->not_found = __( 'No News Found' );
	$labels->not_found_in_trash = __( 'No News Found in Trash' );
}
add_action( 'init', 'change_post_object_label' );

:)


Viewing all articles
Browse latest Browse all 9

Latest Images

Trending Articles



Latest Images