here for the post type
function cptui_register_my_cpts_entreprises() {
/**
* Post Type: entreprises.
*/
$labels = array(
"name" => __( "entreprises", "" ),
"singular_name" => __( "entreprise", "" ),
);
$args = array(
"label" => __( "entreprises", "" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"has_archive" => true,
"show_in_menu" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => true,
"rewrite" => array( "slug" => "entreprises", "with_front" => true ),
"query_var" => true,
"menu_icon" => "dashicons-admin-home",
"supports" => array( "title", "editor", "thumbnail", "excerpt", "trackbacks", "custom-fields", "page-attributes", "post-formats" ),
"taxonomies" => array( "caterogies_entreprises", "type_de_vente", "localisation", "immobilier_professionnel" ),
);
register_post_type( "entreprises", $args );
}
add_action( 'init', 'cptui_register_my_cpts_entreprises' );
and here for the tax
function cptui_register_my_taxes_caterogies_entreprises() {
/**
* Taxonomy: Catégories entreprises.
*/
$labels = array(
"name" => __( "Catégories entreprises", "" ),
"singular_name" => __( "Catégorie entreprise", "" ),
);
$args = array(
"label" => __( "Catégories entreprises", "" ),
"labels" => $labels,
"public" => true,
"hierarchical" => true,
"label" => "Catégories entreprises",
"show_ui" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"query_var" => true,
"rewrite" => array( 'slug' => 'caterogies_entreprises', 'with_front' => true, ),
"show_admin_column" => false,
"show_in_rest" => false,
"rest_base" => "",
"show_in_quick_edit" => false,
);
register_taxonomy( "caterogies_entreprises", array( "entreprises" ), $args );
}
add_action( 'init', 'cptui_register_my_taxes_caterogies_entreprises' );