Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tomdevisser/e789cc6e819b5797d90fc3d2a74fcb50 to your computer and use it in GitHub Desktop.
Save tomdevisser/e789cc6e819b5797d90fc3d2a74fcb50 to your computer and use it in GitHub Desktop.
<?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