<?php 

function cptui_register_my_cpts_productos() {

	/**
	 * Post Type: Productos.
	 */
	$labels = array(
		"name" => __( "Productos", "EMQ" ),
		"singular_name" => __( "Producto", "EMQ" ),
		"menu_name" => __( "Productos", "EMQ" ),
		"all_items" => __( "Todos los productos", "EMQ" ),
		"add_new" => __( "Agregar producto", "EMQ" ),
		"add_new_item" => __( "Añadir nuevo producto", "EMQ" ),
		"edit_item" => __( "Editar producto", "EMQ" ),
		"new_item" => __( "Nuevo producto", "EMQ" ),
		"view_item" => __( "Ver producto", "EMQ" ),
		"view_items" => __( "Ver producto", "EMQ" ),
		"search_items" => __( "Buscar producto", "EMQ" ),
		"not_found" => __( "No se encontró el producto", "EMQ" ),
		"not_found_in_trash" => __( "No se encontro en la papelera", "EMQ" ),
		"featured_image" => __( "Imagen destacada", "EMQ" ),
		"set_featured_image" => __( "Establecer imagen destacada", "EMQ" ),
		"remove_featured_image" => __( "Remover imagen destacada", "EMQ" ),
		"use_featured_image" => __( "Utilizar como imagen destacada", "EMQ" ),
	);

	$args = array(
		"label" => __( "Productos", "EMQ" ),
		"labels" => $labels,
		"description" => "",
		"public" => true,
		"publicly_queryable" => true,
		"show_ui" => true,
		"delete_with_user" => false,
		"show_in_rest" => false,
		"rest_base" => "",
		"rest_controller_class" => "WP_REST_Posts_Controller",
		"has_archive" => false,
		"show_in_menu" => true,
		"show_in_nav_menus" => true,
		"exclude_from_search" => false,
		"capability_type" => "post",
		"map_meta_cap" => true,
		"hierarchical" => false,
		"rewrite" => array( "slug" => "producto", "with_front" => true ),
		"query_var" => true,
		"menu_icon" => "dashicons-block-default",
		"supports" => array( "title", "editor", "thumbnail", "custom-fields", "author" ),
		"show_in_graphql" => true,
		"hierarchical" => true,
		"graphql_single_name" => "producto",
		"graphql_plural_name" => "productos",
		'taxonomies' => array( 'category' ),
	);

	register_post_type( "producto", $args );
}

add_action( 'init', 'cptui_register_my_cpts_productos' );

?>