Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Max – Post Type – Menu

if ( ! function_exists('cntv_menu_post_type') ) {

// Register Custom Post Type
function cntv_menu_post_type() {

	$labels = array(
		'name'                  => _x( 'Menus', 'Post Type General Name', 'centivemax' ),
		'singular_name'         => _x( 'Menu', 'Post Type Singular Name', 'centivemax' ),
		'menu_name'             => __( 'Centive · Menus', 'centivemax' ),
		'name_admin_bar'        => __( 'Centive · Menus', 'centivemax' ),
		'archives'              => __( 'Arquivo de menus', 'centivemax' ),
		'attributes'            => __( 'Atributos do menu', 'centivemax' ),
		'parent_item_colon'     => __( 'Menu principal:', 'centivemax' ),
		'all_items'             => __( 'Todos os menus', 'centivemax' ),
		'add_new_item'          => __( 'Adicionar novo menu', 'centivemax' ),
		'add_new'               => __( 'Adicionar novo', 'centivemax' ),
		'new_item'              => __( 'Novo menu', 'centivemax' ),
		'edit_item'             => __( 'Editar menu', 'centivemax' ),
		'update_item'           => __( 'Atualizar menu', 'centivemax' ),
		'view_item'             => __( 'Ver menu', 'centivemax' ),
		'view_items'            => __( 'Ver menus', 'centivemax' ),
		'search_items'          => __( 'Buscar menu', 'centivemax' ),
		'not_found'             => __( 'Nada encontrado', 'centivemax' ),
		'not_found_in_trash'    => __( 'Nada encontrado na Lixeira', 'centivemax' ),
		'featured_image'        => __( 'Imagem destacada', 'centivemax' ),
		'set_featured_image'    => __( 'Escolher imagem destacada', 'centivemax' ),
		'remove_featured_image' => __( 'Remover imagem destacada', 'centivemax' ),
		'use_featured_image'    => __( 'Usar como imagem destacada', 'centivemax' ),
		'insert_into_item'      => __( 'Inserir no menu', 'centivemax' ),
		'uploaded_to_this_item' => __( 'Carregado para este menu', 'centivemax' ),
		'items_list'            => __( 'Lista dos menus', 'centivemax' ),
		'items_list_navigation' => __( 'Navegação de lista dos menus', 'centivemax' ),
		'filter_items_list'     => __( 'Filtrar lista de menus', 'centivemax' ),
	);
	$capabilities = array(
		'edit_post'             => 'update_core',
		'read_post'             => 'update_core',
		'delete_post'           => 'update_core',
		'edit_posts'            => 'update_core',
		'edit_others_posts'     => 'update_core',
		'publish_posts'         => 'update_core',
		'read_private_posts'    => 'update_core',
	);
	$args = array(
		'label'                 => __( 'Menu', 'centivemax' ),
		'description'           => __( 'Crie Menus personalizados', 'centivemax' ),
		'labels'                => $labels,
		'supports'              => array( 'title' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 100,
		'menu_icon'             => 'dashicons-star-filled',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => false,
		'exclude_from_search'   => true,
		'publicly_queryable'    => true,
		'capabilities'          => $capabilities,
		'show_in_rest'          => false,
	);
	register_post_type( 'cntv-menu', $args );

}
add_action( 'init', 'cntv_menu_post_type', 0 );

}