Skip to content

Instantly share code, notes, and snippets.

@DarioBF
Created June 13, 2019 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarioBF/1ab936559a2fdcdeb4282215fc8431e4 to your computer and use it in GitHub Desktop.
Save DarioBF/1ab936559a2fdcdeb4282215fc8431e4 to your computer and use it in GitHub Desktop.
// Añado otra taxonomía, esta vez no es jerárquica, como las etiquetas.
$labels = array(
'name' => _x( 'Escritores', 'taxonomy general name' ),
'singular_name' => _x( 'Escritor', 'taxonomy singular name' ),
'search_items' => __( 'Buscar Escritores' ),
'popular_items' => __( 'Escritores populares' ),
'all_items' => __( 'Todos los escritores' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Editar Escritor' ),
'update_item' => __( 'Actualizar Escritor' ),
'add_new_item' => __( 'Añadir nuevo Escritor' ),
'new_item_name' => __( 'Nombre del nuevo Escritor' ),
'separate_items_with_commas' => __( 'Separar Escritores por comas' ),
'add_or_remove_items' => __( 'Añadir o eliminar Escritores' ),
'choose_from_most_used' => __( 'Escoger entre los Escritores más utilizados' )
);
register_taxonomy( 'escritor', 'libro', array(
'hierarchical' => false,
'labels' => $labels, /* ADVERTENCIA: Aquí es donde se utiliza la variable $labels */
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'escritor' ),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment