Created
April 11, 2018 13:52
-
-
Save wichaksono/288768f66cb02c2d4a158e85d318b2fc to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Registrasi Taxonomy | |
*/ | |
add_action( 'init', 'onphpid_taxonomy' , 0 ); | |
function onphpid_taxonomy() { | |
// registrasi category product | |
register_taxonomy( | |
'product_category', | |
'onphpid_products', // post-type name | |
array( | |
'label' => __( 'Product Category' ), | |
'rewrite' => array( 'slug' => 'product-category' ), | |
'hierarchical' => true, // true agar menjadi Category | |
) | |
); | |
// registrasi tags product | |
register_taxonomy( | |
'product_tags', | |
'onphpid_products', // post-type name | |
array( | |
'label' => __( 'Product Tags' ), | |
'rewrite' => array( 'slug' => 'product-tags' ), | |
'hierarchical' => false, // false agar menjadi tags | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment