Created
October 30, 2011 04:18
-
-
Save billerickson/1325474 to your computer and use it in GitHub Desktop.
Create Price Range 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 Price Range Taxonomy | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/wordpress-custom-taxonomies/ | |
* | |
*/ | |
function be_register_price_range_taxonomy() { | |
$labels = array( | |
'name' => 'Price Ranges', | |
'singular_name' => 'Price Range', | |
'search_items' => 'Search Price Ranges', | |
'all_items' => 'All Price Ranges', | |
'edit_item' => 'Edit Price Range', | |
'update_item' => 'Update Price Range', | |
'add_new_item' => 'Add New Price Range', | |
'new_item_name' => 'New Price Range Name', | |
'menu_name' => 'Price Range' | |
); | |
register_taxonomy( 'price-range', array('projects'), | |
array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'price-range' ), | |
) | |
); | |
} | |
add_action( 'init', 'be_register_price_range_taxonomy' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment