CPT ventas v0
if ( ! function_exists('custom_post_type_venta') ) {
// Register Custom Post Type
function custom_post_type_venta() {
$labels = array(
'name' => _x( 'Ventas', 'Post Type General Name', 'custom_post_type_venta' ),
'singular_name' => _x( 'Venta', 'Post Type Singular Name', 'custom_post_type_venta' ),
'menu_name' => __( 'Ventas', 'custom_post_type_venta' ),
'name_admin_bar' => __( 'Ventas', 'custom_post_type_venta' ),
'archives' => __( 'archivos de ventas', 'custom_post_type_venta' ),
'attributes' => __( 'atributos de venta', 'custom_post_type_venta' ),
'parent_item_colon' => __( 'Area compra venta', 'custom_post_type_venta' ),
'all_items' => __( 'Todas las ventas', 'custom_post_type_venta' ),
'add_new_item' => __( 'Añadir nueva venta', 'custom_post_type_venta' ),
'add_new' => __( 'Añadir venta', 'custom_post_type_venta' ),
'new_item' => __( 'Nueva venta', 'custom_post_type_venta' ),
'edit_item' => __( 'Editar venta', 'custom_post_type_venta' ),
'update_item' => __( 'Actualizar venta', 'custom_post_type_venta' ),
'view_item' => __( 'Ver venta', 'custom_post_type_venta' ),
'view_items' => __( 'Ver ventas', 'custom_post_type_venta' ),
'search_items' => __( 'Buscar ventas', 'custom_post_type_venta' ),
'not_found' => __( 'Venta no encontrada', 'custom_post_type_venta' ),
'not_found_in_trash' => __( 'No encontrado en papelera', 'custom_post_type_venta' ),
'featured_image' => __( 'Imágenes destacadas', 'custom_post_type_venta' ),
'set_featured_image' => __( 'Seleccionar imagen destacada', 'custom_post_type_venta' ),
'remove_featured_image' => __( 'Quitar imagen destacada', 'custom_post_type_venta' ),
'use_featured_image' => __( 'Usar como imagen destacada', 'custom_post_type_venta' ),
'insert_into_item' => __( 'Insertar en venta', 'custom_post_type_venta' ),
'uploaded_to_this_item' => __( 'Subido a esta venta', 'custom_post_type_venta' ),
'items_list' => __( 'Lista de ventas', 'custom_post_type_venta' ),
'items_list_navigation' => __( 'Navegar lista de ventas', 'custom_post_type_venta' ),
'filter_items_list' => __( 'Filtrar lista de ventas', 'custom_post_type_venta' ),
);
$args = array(
'label' => __( 'Venta', 'custom_post_type_venta' ),
'description' => __( 'cpt_custom_ventas', 'custom_post_type_venta' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', 'custom-fields', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-megaphone',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => false,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'ventas', $args );
}
add_action( 'init', 'custom_post_type_venta', 0 );
}