Creación del CPT Podcasts
Creación del CPT Podcasts
if ( ! function_exists('drg_podcasts') ) { // Register Custom Post Type function drg_podcasts() { $labels = array( 'name' => _x( 'Podcasts', 'Post Type General Name', 'drg_podcasts' ), 'singular_name' => _x( 'Podcast', 'Post Type Singular Name', 'drg_podcasts' ), 'menu_name' => __( 'Podcasts', 'drg_podcasts' ), 'name_admin_bar' => __( 'Podcasts', 'drg_podcasts' ), 'archives' => __( 'Archivo Podcasts', 'drg_podcasts' ), 'attributes' => __( 'Atributo Podcasts', 'drg_podcasts' ), 'parent_item_colon' => __( 'Podcast Padre', 'drg_podcasts' ), 'all_items' => __( 'Todos los podcasts', 'drg_podcasts' ), 'add_new_item' => __( 'Añadir nuevo podcast', 'drg_podcasts' ), 'add_new' => __( 'Añadir podcast', 'drg_podcasts' ), 'new_item' => __( 'Nuevo podcast', 'drg_podcasts' ), 'edit_item' => __( 'Editar podcast', 'drg_podcasts' ), 'update_item' => __( 'Actualizar podcast', 'drg_podcasts' ), 'view_item' => __( 'Ver podcast', 'drg_podcasts' ), 'view_items' => __( 'Ver podcasts', 'drg_podcasts' ), 'search_items' => __( 'Buscar podcast', 'drg_podcasts' ), 'not_found' => __( 'No se ha encontrado', 'drg_podcasts' ), 'not_found_in_trash' => __( 'No se ha encontrado en la papelera', 'drg_podcasts' ), 'featured_image' => __( 'Imagen destacada', 'drg_podcasts' ), 'set_featured_image' => __( 'Asignar imagen destacada', 'drg_podcasts' ), 'remove_featured_image' => __( 'Eliminar imagen destacada', 'drg_podcasts' ), 'use_featured_image' => __( 'Usar como imagen destacada', 'drg_podcasts' ), 'insert_into_item' => __( 'Insertar en podcast', 'drg_podcasts' ), 'uploaded_to_this_item' => __( 'Subido a este podcast', 'drg_podcasts' ), 'items_list' => __( 'Lista de podcasts', 'drg_podcasts' ), 'items_list_navigation' => __( 'Lista de navegacion de podcasts', 'drg_podcasts' ), 'filter_items_list' => __( 'Filtrar lista de podcasts', 'drg_podcasts' ), ); $rewrite = array( 'slug' => 'podcasts', 'with_front' => false, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => __( 'Podcast', 'drg_podcasts' ), 'description' => __( 'Episodios del podcast', 'drg_podcasts' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'page-attributes' ), 'taxonomies' => array( 'category' ), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 10, 'menu_icon' => 'dashicons-controls-volumeon', 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', ); register_post_type( 'drg_podcasts', $args ); } add_action( 'init', 'drg_podcasts', 0 ); }