Will McLean
Process diary

Rename the default WordPress posts

Created: April 19, 2018

To rename the default WordPress posts put this into your functions.php file.

function change_post_label() {
    global $menu;
    global $submenu;
    $menu[5][0] = 'Journals';
    $submenu['edit.php'][5][0] = 'All Journals';
    $submenu['edit.php'][10][0] = 'Add Journal';
}
function change_post_object() {
    global $wp_post_types;
    $labels = &$wp_post_types['post']->labels;
    $labels->name = 'Journal';
    $labels->singular_name = 'Journal';
    $labels->add_new = 'Add Journal';
    $labels->add_new_item = 'Add Journal';
    $labels->edit_item = 'Edit Journal';
    $labels->new_item = 'Journal';
    $labels->view_item = 'View Journal';
    $labels->search_items = 'Search Journal';
    $labels->not_found = 'No Journal found';
    $labels->not_found_in_trash = 'No Journal found in Trash';
    $labels->all_items = 'All Journal';
    $labels->menu_name = 'Journal';
    $labels->name_admin_bar = 'Journal';
}

add_action( 'admin_menu', 'change_post_label' );
add_action( 'init', 'change_post_object' );

This is a Knowledge Base post.