Ordenes de trabajo 02
if ( ! function_exists('ordenes_trabajo') ) {
// Register Custom Post Type
function ordenes_trabajo() {
$labels = array(
'name' => _x( 'Ordenes', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Orden', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Ordenes de Trabajo', 'text_domain' ),
'name_admin_bar' => __( 'Ordenes de Trabajo', 'text_domain' ),
'archives' => __( 'Ordenes', 'text_domain' ),
'attributes' => __( 'Atributos', 'text_domain' ),
'parent_item_colon' => __( 'Heredados', 'text_domain' ),
'all_items' => __( 'Todos', 'text_domain' ),
'add_new_item' => __( 'Agrega', 'text_domain' ),
'add_new' => __( 'Crear Nuevo', 'text_domain' ),
'new_item' => __( 'Nuevo', 'text_domain' ),
'edit_item' => __( 'Editar', 'text_domain' ),
'update_item' => __( 'Actualizar', 'text_domain' ),
'view_item' => __( 'Ver', 'text_domain' ),
'view_items' => __( 'Ver varios', 'text_domain' ),
'search_items' => __( 'Buscar', 'text_domain' ),
'not_found' => __( 'No encontrado', 'text_domain' ),
'not_found_in_trash' => __( 'No en Papelera', 'text_domain' ),
'featured_image' => __( 'Imagen destacada', 'text_domain' ),
'set_featured_image' => __( 'Set Imagen destacada', 'text_domain' ),
'remove_featured_image' => __( 'Remover imagen', 'text_domain' ),
'use_featured_image' => __( 'Agregar la Imagen', 'text_domain' ),
'insert_into_item' => __( 'Agregar en', 'text_domain' ),
'uploaded_to_this_item' => __( 'Subido', 'text_domain' ),
'items_list' => __( 'Lista', 'text_domain' ),
'items_list_navigation' => __( 'Lista de navegacion', 'text_domain' ),
'filter_items_list' => __( 'Filtrar', 'text_domain' ),
);
$rewrite = array(
'slug' => 'ordenes_trabajo',
'with_front' => true,
'pages' => true,
'feeds' => false,
);
$capabilities = array(
'edit_post' => 'editar_orden',
'read_post' => 'leer_ordenes',
'delete_post' => 'borrar_orden',
'edit_posts' => 'editar_post',
'edit_others_posts' => 'editar_otras_ordenes',
'publish_posts' => 'publicar_orden',
'read_private_posts' => 'leer_private_orden',
);
$args = array(
'label' => __( 'Orden', 'text_domain' ),
'description' => __( 'descripcion de ordenes de trabajo', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'comments', 'custom-fields' ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-randomize',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => true,
'publicly_queryable' => true,
'query_var' => 'ordenes_trabajo',
'rewrite' => $rewrite,
'capabilities' => $capabilities,
'show_in_rest' => true,
);
register_post_type( 'ordenes_trabajo', $args );
}
add_action( 'init', 'ordenes_trabajo', 0 );
}