Created
February 24, 2020 15:26
-
-
Save davidallenlewis/e6f63210e09d3f8e336c2254b2cb8083 to your computer and use it in GitHub Desktop.
Rename WordPress Posts to News
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ******************************* | |
// 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