Add/overwrite a parameter on an existing post type/taxonomy

you could modify the global variable $wp_post_types or in the case of taxonomies, $wp_taxonomies

for example, this will change the menu name and all the labels for the default Posts to Bacon:

function change_post_menu_label() {
    global $menu;
    global $submenu;
    $menu[5][0] = 'Bacon';
    $submenu['edit.php'][5][0] = 'Bacon';
    $submenu['edit.php'][10][0] = 'Add Bacon';
    $submenu['edit.php'][16][0] = 'Bacon Tags';
    echo '';
}
function change_post_object_label() {
    global $wp_post_types;
    $labels = &$wp_post_types['post']->labels;
    $labels->name="Bacon";
    $labels->singular_name="Bacon";
    $labels->add_new = 'Add Bacon';
    $labels->add_new_item = 'Add Bacon';
    $labels->edit_item = 'Edit Bacon';
    $labels->new_item = 'Bacon';
    $labels->view_item = 'View Bacon';
    $labels->search_items="Search Bacon";
    $labels->not_found = 'No Bacon found';
    $labels->not_found_in_trash="No Bacon found in Trash";
}
add_action( 'init', 'change_post_object_label' );
add_action( 'admin_menu', 'change_post_menu_label' );

source:
http://new2wp.com/snippet/change-wordpress-posts-post-type-news/

Leave a Comment