Last active
February 12, 2016 22:26
-
-
Save leadbellydesign/f718417528ce15cbfa91 to your computer and use it in GitHub Desktop.
WordPress: Custom label text for custom post type labels #snippet #WordPress
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
/** | |
* Change the post type labels | |
* http://www.paulund.co.uk/change-posts-text-in-admin-menu | |
*/ | |
function change_post_type_labels() { | |
global $wp_post_types; | |
// Get the post labels | |
$postLabels = $wp_post_types['custom_post_type']->labels; | |
$postLabels->name = 'Articles'; | |
$postLabels->singular_name = 'Articles'; | |
$postLabels->add_new = 'Add Articles'; | |
$postLabels->add_new_item = 'Add Articles'; | |
$postLabels->edit_item = 'Edit Articles'; | |
$postLabels->new_item = 'Articles'; | |
$postLabels->view_item = 'View Articles'; | |
$postLabels->search_items = 'Search Articles'; | |
$postLabels->not_found = 'No Articles found'; | |
$postLabels->not_found_in_trash = 'No Articles found in Trash'; | |
} | |
add_action( 'init', 'change_post_type_labels' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment