Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Untitled Snippet

// Register Custom Post Type
function mat_utfsm_post_eventos() {

	$labels = array(
		'name'                  => _x( 'Eventos', 'Post Type General Name', 'mat_utfsm_eventos' ),
		'singular_name'         => _x( 'Evento', 'Post Type Singular Name', 'mat_utfsm_eventos' ),
		'menu_name'             => __( 'Eventos', 'mat_utfsm_eventos' ),
		'name_admin_bar'        => __( 'Eventos', 'mat_utfsm_eventos' ),
		'archives'              => __( 'Archivo de Eventos', 'mat_utfsm_eventos' ),
		'attributes'            => __( 'Atributos', 'mat_utfsm_eventos' ),
		'parent_item_colon'     => __( 'Eventos:', 'mat_utfsm_eventos' ),
		'all_items'             => __( 'Todos los Eventos', 'mat_utfsm_eventos' ),
		'add_new_item'          => __( 'Agregar nuevo Evento', 'mat_utfsm_eventos' ),
		'add_new'               => __( 'Agregar Nuevo', 'mat_utfsm_eventos' ),
		'new_item'              => __( 'Nuevo Evento', 'mat_utfsm_eventos' ),
		'edit_item'             => __( 'Editar Evento', 'mat_utfsm_eventos' ),
		'update_item'           => __( 'Actualizar Evento', 'mat_utfsm_eventos' ),
		'view_item'             => __( 'Ver Evento', 'mat_utfsm_eventos' ),
		'view_items'            => __( 'Ver Eventos', 'mat_utfsm_eventos' ),
		'search_items'          => __( 'Buscar Evento', 'mat_utfsm_eventos' ),
		'not_found'             => __( 'No se ha encontrado', 'mat_utfsm_eventos' ),
		'not_found_in_trash'    => __( 'No se ha encontrado en papelera', 'mat_utfsm_eventos' ),
		'featured_image'        => __( 'Imagen Destacada', 'mat_utfsm_eventos' ),
		'set_featured_image'    => __( 'Elegir Imagen Destacada', 'mat_utfsm_eventos' ),
		'remove_featured_image' => __( 'Quitar Imagen Destacada', 'mat_utfsm_eventos' ),
		'use_featured_image'    => __( 'Usar como Imagen Destacada', 'mat_utfsm_eventos' ),
		'insert_into_item'      => __( 'Insertar en Evento', 'mat_utfsm_eventos' ),
		'uploaded_to_this_item' => __( 'Subido a este Evento', 'mat_utfsm_eventos' ),
		'items_list'            => __( 'Lista de Eventos', 'mat_utfsm_eventos' ),
		'items_list_navigation' => __( 'Navegacion de Eventos', 'mat_utfsm_eventos' ),
		'filter_items_list'     => __( 'Filtrar Lista de Eventos', 'mat_utfsm_eventos' ),
	);
	$args = array(
		'label'                 => __( 'Evento', 'mat_utfsm_eventos' ),
		'description'           => __( 'Post para eventos', 'mat_utfsm_eventos' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'thumbnail' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-calendar',
		'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'       => 'page',
	);
	register_post_type( 'eventos', $args );

}
add_action( 'init', 'mat_utfsm_post_eventos', 0 );