Taxonomy Generator

Overview

Use this tool to create custom code for Taxonomies with register_taxonomy() function.

Usage

  • Fill in the user-friendly form.
  • Click the “Update Code” button.
  • Copy the code to your project.
  • Or save it as a snippet and share with the community.

Examples

If you are still learning how to use this tool, check out the following examples:

The function used in the code.
Add Child Themes Support.
Translation file Text Domain. Optional.
Key used in the code. Up to 32 characters, lowercase.
Taxonomy singular name.
Taxonomy plural name.
Comma separated list of Post Types.
Hierarchical taxonomy allows descendants.
Show this taxonomy in the admin UI.
Show taxonomy managing UI in the admin.
Show taxonomy columns on associated post-types.
Show in tag cloud widget.
Taxonomy available for selection in Navigation Menus.
Direct query variable used in WP_Query. e.g. WP_Query( array( 'taxonomy' => 'genre', 'term' => 'comedy' ) )
Custom query variable.
Set custom user capabilities to manage taxonomy. Default: category capabilities
Whether to include the taxonomy in the REST API.
To change the base url of REST API route. Default is the taxonomy key.
REST API Controller class name. Default is 'WP_REST_Terms_Controller'.
A function name that will be called when the count of an associated Post Type is updated.
  Save Snippet
if ( ! function_exists( 'va_taxonomia_porfolio' ) ) {

// Register Custom Taxonomy
function va_taxonomia_porfolio() {

	$labels = array(
		'name'                       => _x( 'Porfolios', 'Taxonomy General Name', 'va_taxonomia_porfolio' ),
		'singular_name'              => _x( 'Porfolio', 'Taxonomy Singular Name', 'va_taxonomia_porfolio' ),
		'menu_name'                  => __( 'Porfolio', 'va_taxonomia_porfolio' ),
		'all_items'                  => __( 'Todos los Porfolio', 'va_taxonomia_porfolio' ),
		'parent_item'                => __( 'Porfolio Padre', 'va_taxonomia_porfolio' ),
		'parent_item_colon'          => __( 'Porfolio Padre:', 'va_taxonomia_porfolio' ),
		'new_item_name'              => __( 'Nuevo tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'add_new_item'               => __( 'Añadir tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'edit_item'                  => __( 'Editar tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'update_item'                => __( 'Actualizar tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'view_item'                  => __( 'Ver tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'separate_items_with_commas' => __( 'Separate items with commas', 'va_taxonomia_porfolio' ),
		'add_or_remove_items'        => __( 'Añadir o eliminar tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'va_taxonomia_porfolio' ),
		'popular_items'              => __( 'Tipo de Porfolio más popular', 'va_taxonomia_porfolio' ),
		'search_items'               => __( 'Buscar tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'not_found'                  => __( 'No encontrado ningún tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'no_terms'                   => __( 'No existen tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'items_list'                 => __( 'Lista de tipo de Porfolio', 'va_taxonomia_porfolio' ),
		'items_list_navigation'      => __( 'Navegar por la lista de tipo de Porfolio', 'va_taxonomia_porfolio' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => false,
	);
	register_taxonomy( 'porfolio', array( 'va_porfolio' ), $args );

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

}