Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Generate Custom Post Type ‘Sucursales’ (Spanish labels)

// Register Custom Post Type
function generate_sucurales_custom_post_type() {

	$labels = array(
		'name'                  => _x( 'Sucursales', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( 'Sucursal', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( 'Sucursales', 'text_domain' ),
		'name_admin_bar'        => __( 'Sucursales', 'text_domain' ),
		'archives'              => __( 'Vista de Sucursales', 'text_domain' ),
		'attributes'            => __( 'Atributos de Sucursal', 'text_domain' ),
		'parent_item_colon'     => __( 'Sucursal padre', 'text_domain' ),
		'all_items'             => __( 'Todas las Sucursales', 'text_domain' ),
		'add_new_item'          => __( 'Agregar nueva Sucursal', 'text_domain' ),
		'add_new'               => __( 'Agregar Nueva', 'text_domain' ),
		'new_item'              => __( 'Nueva Sucursal', 'text_domain' ),
		'edit_item'             => __( 'Editar Sucursal', 'text_domain' ),
		'update_item'           => __( 'Actualizar Sucursal', 'text_domain' ),
		'view_item'             => __( 'Ver Sucursal', 'text_domain' ),
		'view_items'            => __( 'Ver Sucursales', 'text_domain' ),
		'search_items'          => __( 'Buscar Sucursal', 'text_domain' ),
		'not_found'             => __( 'No encontrada', 'text_domain' ),
		'not_found_in_trash'    => __( 'No encontrada en la Papelera', 'text_domain' ),
		'featured_image'        => __( 'Imagen Destacada', 'text_domain' ),
		'set_featured_image'    => __( 'Asignar Imagen Destacada', 'text_domain' ),
		'remove_featured_image' => __( 'Remover Imagen Destacada', 'text_domain' ),
		'use_featured_image'    => __( 'Usar como Imagen Destacada', 'text_domain' ),
		'insert_into_item'      => __( 'Insertar en Sucursal', 'text_domain' ),
		'uploaded_to_this_item' => __( 'Subir a esta Sucursal', 'text_domain' ),
		'items_list'            => __( 'Lista de Sucursales', 'text_domain' ),
		'items_list_navigation' => __( 'Lista de navegación de Sucursales', 'text_domain' ),
		'filter_items_list'     => __( 'Filtrar lista de Sucursales', 'text_domain' ),
	);
	$args = array(
		'label'                 => __( 'Sucursal', 'text_domain' ),
		'description'           => __( 'Post Type Description', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'thumbnail' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 20,
		'menu_icon'             => 'dashicons-store',
		'show_in_admin_bar'     => false,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'capability_type'       => 'page',
		'show_in_rest'          => false,
	);
	register_post_type( 'sucursales', $args );

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