Skip to content

Instantly share code, notes, and snippets.

@AndreFCAmorim
Created November 23, 2022 09:05
Show Gist options
  • Save AndreFCAmorim/b7608a8373cac81ce84011f4b46cb01d to your computer and use it in GitHub Desktop.
Save AndreFCAmorim/b7608a8373cac81ce84011f4b46cb01d to your computer and use it in GitHub Desktop.
Rename the default taxonomy for posts on WordPress
<?php
add_action('init', 'renameCategory');
function renameCategory() {
global $wp_taxonomies;
$cat = $wp_taxonomies['category'];
$cat->label = 'My Categories';
$cat->labels->singular_name = 'My Categorie';
$cat->labels->name = $cat->label;
$cat->labels->menu_name = $cat->label;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment