Skip to content

Instantly share code, notes, and snippets.

@skyshab
Created January 27, 2017 19:24
Show Gist options
  • Save skyshab/ec8476819c94c145ae4aeb2b32e057c5 to your computer and use it in GitHub Desktop.
Save skyshab/ec8476819c94c145ae4aeb2b32e057c5 to your computer and use it in GitHub Desktop.
rename custom taxonomy
add_action( 'init', 'my_modify_taxonomy', 11 );
function my_modify_taxonomy() {
// get the arguments of the already-registered taxonomy
$my_category_args = get_taxonomy( 'project_category' );
// make changes
$my_category_args->rewrite['slug'] = 'beer_style';
// re-register the taxonomy
register_taxonomy( 'project_category', 'beer', (array) $my_category_args );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment