cpt
if ( ! function_exists('fedepadilla_cpt') ) {
// Register Custom Post Type
function fedepadilla_cpt() {
$labels = array(
'name' => _x( 'podcasts', 'Post Type General Name', 'fedepadilla_cpt' ),
'singular_name' => _x( 'podcast', 'Post Type Singular Name', 'fedepadilla_cpt' ),
'menu_name' => __( 'Podcast', 'fedepadilla_cpt' ),
'name_admin_bar' => __( 'Podcast', 'fedepadilla_cpt' ),
'archives' => __( 'Archivos de podcast', 'fedepadilla_cpt' ),
'attributes' => __( 'Atributos del podcast', 'fedepadilla_cpt' ),
'parent_item_colon' => __( 'Parent Item:', 'fedepadilla_cpt' ),
'all_items' => __( 'Todos los podcast', 'fedepadilla_cpt' ),
'add_new_item' => __( 'Agregar nuevo podcast', 'fedepadilla_cpt' ),
'add_new' => __( 'Agregar nuevo', 'fedepadilla_cpt' ),
'new_item' => __( 'Nuevo podcast', 'fedepadilla_cpt' ),
'edit_item' => __( 'Editar podcast', 'fedepadilla_cpt' ),
'update_item' => __( 'Actualizar podcast', 'fedepadilla_cpt' ),
'view_item' => __( 'Ver podcast', 'fedepadilla_cpt' ),
'view_items' => __( 'Ver podcasts', 'fedepadilla_cpt' ),
'search_items' => __( 'Buscar podcast', 'fedepadilla_cpt' ),
'not_found' => __( 'No encontrado', 'fedepadilla_cpt' ),
'not_found_in_trash' => __( 'No se encuentra en la papelera', 'fedepadilla_cpt' ),
'featured_image' => __( 'Foto destacada', 'fedepadilla_cpt' ),
'set_featured_image' => __( 'Establecer como imagen destacada', 'fedepadilla_cpt' ),
'remove_featured_image' => __( 'Eliminar imagen destacada', 'fedepadilla_cpt' ),
'use_featured_image' => __( 'Usar como imagen destacada', 'fedepadilla_cpt' ),
'insert_into_item' => __( 'Insertar en el podcast', 'fedepadilla_cpt' ),
'uploaded_to_this_item' => __( 'Subido al podcast', 'fedepadilla_cpt' ),
'items_list' => __( 'Lista de podcasts', 'fedepadilla_cpt' ),
'items_list_navigation' => __( 'Navegar en lista de podcast', 'fedepadilla_cpt' ),
'filter_items_list' => __( 'Filtrar lista de podcast', 'fedepadilla_cpt' ),
);
$args = array(
'label' => __( 'podcast', 'fedepadilla_cpt' ),
'description' => __( 'Podcast con las funciones de un post', 'fedepadilla_cpt' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats' ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-microphone',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
'show_in_rest' => true,
);
register_post_type( 'podcast', $args );
}
add_action( 'init', 'fedepadilla_cpt', 0 );
}