Created
July 14, 2012 04:38
-
-
Save mannieschumpert/3109226 to your computer and use it in GitHub Desktop.
WordPress: Custom 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
<?php | |
// Create *_ taxonomy | |
add_action( 'init', 'create_TAXONOMYNAME' ); | |
function create_TAXONOMYNAME() { | |
$labels = array( | |
'name' => _x( 'PLURAL', 'taxonomy general name' ), | |
'singular_name' => _x( 'SINGULAR', 'taxonomy singular name' ), | |
'search_items' => __( 'Search PLURAL' ), | |
'all_items' => __( 'All PLURAL' ), | |
'parent_item' => __( 'Parent SINGULAR' ), | |
'parent_item_colon' => __( 'Parent SINGULAR:' ), | |
'edit_item' => __( 'Edit SINGULAR' ), | |
'update_item' => __( 'Update SINGULAR' ), | |
'add_new_item' => __( 'Add New SINGULAR' ), | |
'new_item_name' => __( 'New SINGULAR Name' ), | |
); | |
register_taxonomy('PLURAL','POST-TYPE',array( | |
'hierarchical' => true, // false for tags | |
'labels' => $labels | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment