WordPress Plugin Development

Custom Taxonomies in WordPress

November 2015

Define a Custom Taxonomy add_action( ‘init’, ‘ww_create_taxonomies’ ); function ww_create_taxonomies() { // Add new taxonomy, NOT hierarchical (like tags) register_taxonomy( ‘ww_languages’, // Unique ID for the “Languages” taxonomy. (always use a prefix) ‘ww_products’, // The post-type(s) this taxonomy can be applied-to . array( ‘hierarchical’ => false, ‘labels’ => array( ‘name’ => _x( ‘Languages’, ‘taxonomy general