Skip to content

Instantly share code, notes, and snippets.

@pabloselin
Created June 2, 2014 19:54
Show Gist options
  • Save pabloselin/4b43435626e973c31e03 to your computer and use it in GitHub Desktop.
Save pabloselin/4b43435626e973c31e03 to your computer and use it in GitHub Desktop.
Create custom taxonomy
<?php
function sgc_createcustomtax() {
$labels = array(
'name' => 'Temas',
'singular_name' => 'Tema',
'search_items' => 'Buscar temas',
'popular_items' => 'Temas más populares',
'all_items' => 'Todos los Temas',
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => 'Editar tema',
'update_item' => 'Actualizar tema',
'add_new_item' => 'Agregar nuevo tema',
'new_item_name' => 'Nuevo nombre de tema',
'separate_items_with_commas' => 'Separar temas con una coma',
'add_or_remove_items' => 'Añadir o quitar temas',
'choose_from_most_used' => 'Elegir de los temas más utilizados'
);
register_taxonomy(
'temas',
array(
'post',
'sg_agenda',
'sg_circulares'
),
array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'query_var' => true
)
);
}
add_action('init', 'sgc_createcustomtax');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment