Skip to content

Instantly share code, notes, and snippets.

@GarySwift
Created December 5, 2017 11:15
Show Gist options
  • Save GarySwift/48aa03a44eb23ffc8fa4ea6c6e6a8289 to your computer and use it in GitHub Desktop.
Save GarySwift/48aa03a44eb23ffc8fa4ea6c6e6a8289 to your computer and use it in GitHub Desktop.
Custom taxonomy hide meta box but show in menu
<?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