Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Untitled Snippet

if ( ! function_exists('slan_habitaciones_custom_post_type') ) {

// Register Custom Post Type
function slan_habitaciones_custom_post_type() {

	$labels = array(
		'name'                  => _x( 'Habitaciones', 'Post Type General Name', 'slan' ),
		'singular_name'         => _x( 'Habitacion', 'Post Type Singular Name', 'slan' ),
		'menu_name'             => __( 'Habitaciones', 'slan' ),
		'name_admin_bar'        => __( 'Habitacion', 'slan' ),
		'archives'              => __( 'Archivos de habitaciones', 'slan' ),
		'attributes'            => __( 'Artributos de habitaciones', 'slan' ),
		'parent_item_colon'     => __( 'Habitacion padre:', 'slan' ),
		'all_items'             => __( 'Todas las habitaciones', 'slan' ),
		'add_new_item'          => __( 'Añadir nueva habitacion', 'slan' ),
		'add_new'               => __( 'Añadir nueva', 'slan' ),
		'new_item'              => __( 'Nueva habitacion', 'slan' ),
		'edit_item'             => __( 'Editar habitacion', 'slan' ),
		'update_item'           => __( 'Actualizar habitacion', 'slan' ),
		'view_item'             => __( 'Ver habitacion', 'slan' ),
		'view_items'            => __( 'Ver habitaciones', 'slan' ),
		'search_items'          => __( 'Buscar habitacion', 'slan' ),
		'not_found'             => __( 'No encontrado', 'slan' ),
		'not_found_in_trash'    => __( 'No encontrado en papelera', 'slan' ),
		'featured_image'        => __( 'Imagen destacada', 'slan' ),
		'set_featured_image'    => __( 'Establecer imagen destacada', 'slan' ),
		'remove_featured_image' => __( 'Remover imagen destacada', 'slan' ),
		'use_featured_image'    => __( 'Usar como imagen destacada', 'slan' ),
		'insert_into_item'      => __( 'Insertar en habitacion', 'slan' ),
		'uploaded_to_this_item' => __( 'Subido a habitacion', 'slan' ),
		'items_list'            => __( 'Lista de habitaciones', 'slan' ),
		'items_list_navigation' => __( 'Navegacion en lista de habitaciones', 'slan' ),
		'filter_items_list'     => __( 'Filtrar lista de habitaciones', 'slan' ),
	);
	$args = array(
		'label'                 => __( 'Habitacion', 'slan' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-admin-multisite',
		'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( 'habitaciones', $args );

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

}