-
-
Save freezvd/f84a7c087872b3c27d11 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* Taxonomies | |
* | |
* This file registers any custom taxonomies | |
* | |
* @package CoreFunctionality | |
* @since 1.0.0 | |
* @link https://github.com/billerickson/Core-Functionality | |
* @author Bill Erickson <[email protected]> | |
* @copyright Copyright (c) 2011, Bill Erickson | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
*/ | |
/** | |
* Create Category Taxonomy | |
* | |
* @since 1.0.0 | |
* @link http://codex.wordpress.org/Function_Reference/register_taxonomy | |
*/ | |
function ea_register_category_taxonomy() { | |
$labels = array( | |
'name' => 'Product Categories', | |
'singular_name' => 'Category', | |
'search_items' => 'Search Categories', | |
'all_items' => 'All Categories', | |
'parent_item' => 'Parent Category', | |
'parent_item_colon' => 'Parent Category:', | |
'edit_item' => 'Edit Category', | |
'update_item' => 'Update Category', | |
'add_new_item' => 'Add New Category', | |
'new_item_name' => 'New Category Name', | |
'menu_name' => 'Categories' | |
); | |
register_taxonomy( 'products-category', array('products'), | |
array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'product-category' ), | |
) | |
); | |
} | |
add_action( 'init', 'ea_register_category_taxonomy' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment