Skip to content

Instantly share code, notes, and snippets.

@leadbellydesign
Last active February 12, 2016 22:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leadbellydesign/f718417528ce15cbfa91 to your computer and use it in GitHub Desktop.
Save leadbellydesign/f718417528ce15cbfa91 to your computer and use it in GitHub Desktop.
WordPress: Custom label text for custom post type labels #snippet #WordPress
/**
* 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