Post Type personalizado LSM
// Register Custom Post Type
function post_results() {
$labels = array(
'name' => _x( 'Resultados', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Resultado', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Lotería', 'text_domain' ),
'name_admin_bar' => __( 'Lotería', 'text_domain' ),
'archives' => __( 'Lista de Resultados', 'text_domain' ),
'attributes' => __( 'Attributos', 'text_domain' ),
'parent_item_colon' => __( 'Resultado Principal', 'text_domain' ),
'all_items' => __( 'Todos los Resultados', 'text_domain' ),
'add_new_item' => __( 'Añadir Nuevo', 'text_domain' ),
'add_new' => __( 'Añadir Nuevo', 'text_domain' ),
'new_item' => __( 'Nuevo Resultado', 'text_domain' ),
'edit_item' => __( 'Editar Resultado', 'text_domain' ),
'update_item' => __( 'Actualizar Resultado', 'text_domain' ),
'view_item' => __( 'Ver Resultado', 'text_domain' ),
'view_items' => __( 'Ver Resultado', 'text_domain' ),
'search_items' => __( 'Buscar Resultado', 'text_domain' ),
'not_found' => __( 'No hay Resultados', 'text_domain' ),
'not_found_in_trash' => __( 'No hay Resultados', 'text_domain' ),
'featured_image' => __( 'Imagen Resultado', 'text_domain' ),
'set_featured_image' => __( 'Imagen Resultado', 'text_domain' ),
'remove_featured_image' => __( 'Eliminar Imagen Resultado', 'text_domain' ),
'use_featured_image' => __( 'Usar Imagen Resultados', 'text_domain' ),
'insert_into_item' => __( 'Insertar Resultados', 'text_domain' ),
'uploaded_to_this_item' => __( 'Subir a Resultado', 'text_domain' ),
'items_list' => __( 'Lista de Resultados', 'text_domain' ),
'items_list_navigation' => __( 'Navegar por Resultados', 'text_domain' ),
'filter_items_list' => __( 'Filtrar por Resultados', 'text_domain' ),
);
$rewrite = array(
'slug' => 'Resultados',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'Resultado', 'text_domain' ),
'description' => __( 'Post Type of Results', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ),
'taxonomies' => array( 'category' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-awards',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => true,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
'show_in_rest' => true,
);
register_post_type( 'post_type_results', $args );
}
add_action( 'init', 'post_results', 0 );