Created
January 29, 2018 23:23
-
-
Save alimoshen/0317982225881d39991ef787a3014e70 to your computer and use it in GitHub Desktop.
Register Taxonomy
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
add_action( 'init', 'create_expertise_type_taxonomies', 0 ); | |
function create_expertise_type_taxonomies() | |
{ | |
// Add new taxonomy, make it hierarchical => true for categories-like taxonomies) | |
$labels = array( | |
'name' => _x( 'Expertise', 'taxonomy general name' ), | |
'singular_name' => _x( 'Expertise', 'taxonomy singular name' ), | |
'search_items' => __( 'Search Expertise' ), | |
'all_items' => __( 'All Expertises' ), | |
'parent_item' => __( 'Parent Expertise' ), | |
'parent_item_colon' => __( 'Parent Expertise:' ), | |
'edit_item' => __( 'Edit Expertise' ), | |
'update_item' => __( 'Update Expertise' ), | |
'add_new_item' => __( 'Add New Expertise' ), | |
'new_item_name' => __( 'New Expertise' ), | |
'menu_name' => __( 'Expertise' ), | |
); | |
register_taxonomy('expertise_type',array('expertise'), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array('hierarchical' => true), | |
)); | |
} | |
Raw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment