Last active
April 22, 2018 13:44
-
-
Save damiencarbery/d70c19a31e891e7ad126eeeb5a9bc48c to your computer and use it in GitHub Desktop.
Change Taxonomy admin labels: https://www.damiencarbery.com/2018/04/change-taxonomy-admin-labels/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Change Portfolio to Project | |
Plugin URI: https://www.damiencarbery.com/2018/04/change-taxonomy-admin-labels/ | |
Description: Change labels in Genesis Portfolio Pro plugin from Portfolio to Project. | |
Author: Damien Carbery | |
Version: 0.1 | |
*/ | |
add_action( 'registered_post_type', 'dcwd_change_genesis_portfolio_pro_cpt', 10, 2 ); | |
function dcwd_change_genesis_portfolio_pro_cpt( $post_type, $args ) { | |
if ( 'portfolio' === $post_type ) { | |
global $wp_post_types; | |
$args->label = 'Project'; | |
$args->labels->name = 'Our Projects'; | |
$args->labels->menu_name = 'Our Projects'; | |
$args->labels->add_new_item = 'Add New Project'; | |
$args->labels->edit_item = 'Edit Project'; | |
$args->labels->all_items = 'All Projects'; | |
$args->labels->archives = 'All Projects'; | |
$args->labels->not_found_in_trash = 'No Projects found in Trash'; | |
$wp_post_types[ $post_type ] = $args; | |
} | |
} | |
// Change Portfolio Types taxonomy labels to use 'Project' instead of 'Portfolio'. | |
add_filter( 'taxonomy_labels_portfolio-type', 'dcwd_change_genesis_portfolio_pro_taxonomy_labels' ); | |
function dcwd_change_genesis_portfolio_pro_taxonomy_labels( $labels ) { | |
$labels->name = 'Project Types'; | |
$labels->singular_name = 'Project Type'; | |
$labels->edit_item = 'Edit Project Type'; | |
$labels->add_new_item = 'Add New Project Type'; | |
$labels->search_items = 'Search Project Types'; | |
$labels->update_item = 'Update Project Type'; | |
$labels->menu_name = 'Project Types'; | |
return $labels; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Change Portfolio Types taxonomy labels to use 'Project' instead of 'Portfolio'. | |
add_filter( 'taxonomy_labels_portfolio-type', 'dcwd_change_genesis_portfolio_pro_taxonomy_labels' ); | |
function dcwd_change_genesis_portfolio_pro_taxonomy_labels( $labels ) { | |
$labels->name = 'Project Types'; | |
$labels->singular_name = 'Project Type'; | |
$labels->edit_item = 'Edit Project Type'; | |
$labels->add_new_item = 'Add New Project Type'; | |
$labels->search_items = 'Search Project Types'; | |
$labels->update_item = 'Update Project Type'; | |
$labels->menu_name = 'Project Types'; | |
return $labels; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment