Created
December 5, 2017 11:15
-
-
Save GarySwift/48aa03a44eb23ffc8fa4ea6c6e6a8289 to your computer and use it in GitHub Desktop.
Custom taxonomy hide meta box but show in menu
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 | |
function cptui_register_my_taxes_region() { | |
/** | |
* Taxonomy: Regions. | |
*/ | |
$labels = array( | |
"name" => __( "Regions", "twentyseventeen" ), | |
"singular_name" => __( "Region", "twentyseventeen" ), | |
); | |
$args = array( | |
"label" => __( "Regions", "twentyseventeen" ), | |
"labels" => $labels, | |
"public" => true, | |
"hierarchical" => false, | |
"label" => "Regions", | |
"show_ui" => true, | |
"show_in_menu" => true, | |
"show_in_nav_menus" => true, | |
"query_var" => true, | |
"rewrite" => array( 'slug' => 'region', 'with_front' => true, ), | |
"show_admin_column" => true, | |
"show_in_rest" => false, | |
"rest_base" => "", | |
"show_in_quick_edit" => false, | |
'meta_box_cb' => false, | |
); | |
register_taxonomy( "region", array( "dealer" ), $args ); | |
} | |
add_action( 'init', 'cptui_register_my_taxes_region' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://wordpress.stackexchange.com/questions/231125/custom-taxonomy-hide-meta-box-but-show-in-menu