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( 'conversation_topic1000' ) ) {

// Register Custom Taxonomy
function conversation_topic1000() {

	$labels = array(
		'name'                       => _x( 'Conversation Topics', 'Taxonomy General Name', 'conversation_topic1000' ),
		'singular_name'              => _x( 'Conversation Topic', 'Taxonomy Singular Name', 'conversation_topic1000' ),
		'menu_name'                  => __( 'Conversation Topic', 'conversation_topic1000' ),
		'all_items'                  => __( 'All Conversation Topics', 'conversation_topic1000' ),
		'parent_item'                => __( 'Parent Conversation Topic', 'conversation_topic1000' ),
		'parent_item_colon'          => __( 'Parent Conversation Topic:', 'conversation_topic1000' ),
		'new_item_name'              => __( 'New Conversation Topic', 'conversation_topic1000' ),
		'add_new_item'               => __( 'Add New Conversation Topic', 'conversation_topic1000' ),
		'edit_item'                  => __( 'Edit Conversation Topic', 'conversation_topic1000' ),
		'update_item'                => __( 'Update Conversation Topic', 'conversation_topic1000' ),
		'view_item'                  => __( 'View Conversation Topic', 'conversation_topic1000' ),
		'separate_items_with_commas' => __( 'Separate Conversation Topics with commas', 'conversation_topic1000' ),
		'add_or_remove_items'        => __( 'Add or remove Conversation Topics', 'conversation_topic1000' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'conversation_topic1000' ),
		'popular_items'              => __( 'Popular Conversation Topics', 'conversation_topic1000' ),
		'search_items'               => __( 'Search Conversation Topics', 'conversation_topic1000' ),
		'not_found'                  => __( 'Not Found', 'conversation_topic1000' ),
		'no_terms'                   => __( 'No Conversation Topics', 'conversation_topic1000' ),
		'items_list'                 => __( 'Conversation Topics list', 'conversation_topic1000' ),
		'items_list_navigation'      => __( 'Conversation Topics list navigation', 'conversation_topic1000' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'show_in_rest'               => true,
	);
	register_taxonomy( 'conversation_topic1000', array( 'conversacion-ingles' ), $args );

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

}