Skip to content

Instantly share code, notes, and snippets.

@davidallenlewis
Created February 24, 2020 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidallenlewis/e6f63210e09d3f8e336c2254b2cb8083 to your computer and use it in GitHub Desktop.
Save davidallenlewis/e6f63210e09d3f8e336c2254b2cb8083 to your computer and use it in GitHub Desktop.
Rename WordPress Posts to News
// *******************************
// Rename "Posts" to "News"
function change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = 'News';
$submenu['edit.php'][5][0] = 'All Articles';
echo '';
}
function change_post_object_label() {
global $wp_post_types;
$labels = &$wp_post_types['post']->labels;
$labels->name = 'All Articles';
$labels->singular_name = 'News';
$labels->add_new = 'Add New Article';
$labels->add_new_item = 'Add New Article';
$labels->edit_item = 'Edit Article';
$labels->new_item = 'News';
$labels->view_item = 'View Article';
$labels->search_items = 'Search News';
$labels->not_found = 'No articles found';
$labels->not_found_in_trash = 'No articles found in Trash';
}
add_action( 'init', 'change_post_object_label' );
add_action( 'admin_menu', 'change_post_menu_label' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment