Change Custom Post Type Taxonomy Labels

Sometimes taxonomies for custom post types are created by themes and plugins you use on your site. Occasionally you may want to change their names to better reflect their use on your site, without changing the theme/plugin files directly. Add this code to functions.php or to a custom plugin.


<?php /************************************************************** * Change Custom Post Type Taxonomy Labels **************************************************************/ function tft_change_taxonomy_vehicle_type_label() { $t = get_taxonomy('testimonial_author'); //this is the taxonomy name $t->labels->name                            = 'Story Authors';
        $t->labels->singular_name                   = 'Story Author';
        $t->labels->menu_name                       = 'Story Authors';
        $t->labels->all_items                       = 'All Story Authors';
        $t->labels->parent_item                     = 'Parent Story Author';
        $t->labels->parent_item_colon               = 'Parent Story Author:';
        $t->labels->new_item_name                   = 'New Story Author Name';
        $t->labels->add_new_item                    = 'Add New Story Author';
        $t->labels->edit_item                       = 'Edit Story Author';
        $t->labels->update_item                     = 'Update Story Author';
        $t->labels->separate_items_with_commas      = 'Separate Story Authors with commas';
        $t->labels->search_items                    = 'Search Story Authors';
        $t->labels->add_or_remove_items             = 'Add or remove Story Authors';
        $t->labels->choose_from_most_used           = 'Choose from the most used Story Authors';

}
//Must hook into a later hook or priority than the plugin
add_action( 'wp_loaded', 'tft_change_taxonomy_vehicle_type_label', 20);

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *