Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created January 19, 2017 20:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellofromtonya/0b0b7cbcab89dad821a2ca0eb1fdc5d2 to your computer and use it in GitHub Desktop.
Save hellofromtonya/0b0b7cbcab89dad821a2ca0eb1fdc5d2 to your computer and use it in GitHub Desktop.
Registering a custom taxonomy
<?php
/**
* Custom Taxonomy functionality
*
* @package KnowTheCode\TeamBios\Custom
* @since 1.0.0
* @author hellofromTonya
* @link https://knowthecode.io
* @license GNU General Public License 2.0+
*/
namespace KnowTheCode\TeamBios\Custom;
add_action( 'init', __NAMESPACE__ . '\register_custom_taxonomy' );
/**
* Register the taxonomy.
*
* @since 1.0.0
*
* @return void
*/
function register_custom_taxonomy() {
$args = array(
'label' => __( 'Departments', 'teambios' ),
'hierarchical' => true,
);
register_taxonomy( 'department', 'team-bios', $args );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment