Last active
February 9, 2025 22:04
-
-
Save tomdevisser/e789cc6e819b5797d90fc3d2a74fcb50 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 | |
add_action( 'init', 'toms_custom_taxonomy' ); | |
/** | |
* Registers a custom taxonomy with a custom meta box callback, and without | |
* an edit functionality within Quick Edit. | |
* | |
* @return void | |
*/ | |
function toms_custom_taxonomy(): void { | |
register_taxonomy( | |
'example_category', | |
'example', | |
array( | |
'label' => 'Example Categories', | |
'hierarchical' => true, | |
'meta_box_cb' => 'toms_custom_meta_box_with_radio_inputs', | |
'show_in_quick_edit' => false, | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment