Skip to content

Instantly share code, notes, and snippets.

@nciske
Created April 26, 2012 17:29
Show Gist options
  • Save nciske/2501157 to your computer and use it in GitHub Desktop.
Save nciske/2501157 to your computer and use it in GitHub Desktop.
WordPress Change Post to Article
<?php
/* Change Post to Article */
function change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = 'Articles';
$submenu['edit.php'][5][0] = 'Articles';
$submenu['edit.php'][10][0] = 'Add New';
$submenu['edit.php'][16][0] = 'Tags';
//echo '';
}
function change_post_object_label() {
global $wp_post_types;
$labels = &$wp_post_types['post']->labels;
$labels->name = 'Articles';
$labels->singular_name = 'Article';
$labels->add_new = _x('Create', 'Article');
$labels->add_new_item = 'Add New Article';
$labels->edit_item = 'Edit Article';
$labels->new_item = 'New Article';
$labels->view_item = 'View Article';
$labels->search_items = 'Search Articles';
$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