Skip to content

Instantly share code, notes, and snippets.

@ptrsmk
Created June 15, 2017 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptrsmk/9385c10f465cb638cf233a6456b7f050 to your computer and use it in GitHub Desktop.
Save ptrsmk/9385c10f465cb638cf233a6456b7f050 to your computer and use it in GitHub Desktop.
function custom_sex_taxonomy()
{
$labels = array(
'name' => 'Sexes',
'singular_name' => 'Sex',
'menu_name' => 'Puppy’s Sex',
'all_items' => 'All Puppy Sexes',
'parent_item' => 'Parent Item',
'parent_item_colon' => 'Parent Item:',
'new_item_name' => 'New Puppy Sex',
'add_new_item' => 'Add New Puppy Sex',
'edit_item' => 'Edit Puppy’s Sex',
'update_item' => 'Update Puppy’s Sex',
'view_item' => 'View Puppy’s Sex',
'separate_items_with_commas' => 'Separate items with commas',
'add_or_remove_items' => 'Add or remove items',
'choose_from_most_used' => 'Choose from the most used',
'popular_items' => 'Popular Puppy’s Sex',
'search_items' => 'Search Puppy’s Sex',
'not_found' => 'Not Found',
'no_terms' => 'No items',
'items_list' => 'Puppy’s Sex list',
'items_list_navigation' => 'Puppy’s Sex list navigation',
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
);
register_taxonomy('puppy_sex', array(
'product'
) , $args);
register_taxonomy_for_object_type('puppy_sex', 'product');
}
add_action('init', 'custom_sex_taxonomy', 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment