Created
January 19, 2017 20:28
-
-
Save hellofromtonya/0b0b7cbcab89dad821a2ca0eb1fdc5d2 to your computer and use it in GitHub Desktop.
Registering a custom 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 | |
/** | |
* 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