Internal Post Tag Taxonomy Not Visible To Public

Home » Snippets » Internal Post Tag Taxonomy Not Visible To Public
0

Created with:

Taxonomy generator

Visibility: 

public

Creator: WPTurbo Team

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
				/**
 * Registers the 'editorial_tag' taxonomy.
 * 
 * @return void
 */
function wpturbo_register_editorial_tag() : void {
	$labels = [
		'name' => _x( 'Editorial Tags', 'Taxonomy Name', 'wpturbo' ),
		'singular_name' => _x( 'Editorial Tag', 'Taxonomy Singular Name', 'wpturbo' ),
		'menu_name' => __( 'Editorial Tags ', 'wpturbo' ),
		'all_items' => __( 'All Editorial Tags ', 'wpturbo' ),
		'parent_item' => __( 'Parent Editorial Tag ', 'wpturbo' ),
		'parent_item_colon' => __( 'Parent Editorial Tag: ', 'wpturbo' ),
		'new_item_name' => __( 'New Editorial Tag ', 'wpturbo' ),
		'add_new_item' => __( 'Add New Editorial Tag ', 'wpturbo' ),
		'edit_item' => __( 'Edit Editorial Tag ', 'wpturbo' ),
		'update_item' => __( 'Update Editorial Tag ', 'wpturbo' ),
		'view_item' => __( 'View Editorial Tag ', 'wpturbo' ),
		'add_or_remove_items' => __( 'Add or Remove Editorial Tags ', 'wpturbo' ),
		'choose_from_most_used' => __( 'Choose from most used Editorial Tags ', 'wpturbo' ),
		'popular_items' => __( 'Popular Editorial Tags ', 'wpturbo' ),
		'search_items' => __( 'Search Editorial Tags ', 'wpturbo' ),
		'not_found' => __( 'Not Found ', 'wpturbo' ),
		'no_terms' => __( 'No Editorial Tags ', 'wpturbo' ),
		'items_list' => __( 'Editorial Tags List ', 'wpturbo' ),
		'items_list_navigation' => __( 'Editorial Tags List Navigation ', 'wpturbo' ),
	];

	$args = [
		'labels' => $labels,
		'hierarchical' => false,
		'public' => false,
		'show_ui' => true,
		'show_admin_column' => true,
		'show_in_nav_menus' => true,
		'show_tagcloud' => true,
		'rewrite' => false
		'show_in_rest' => true,
		'rest_base' => 'editorial_tag',
		'rest_controller_class' => 'WP_REST_editorial_tag_Controller',
	];

	register_taxonomy( 'editorial_tag', ['post'], $args );
}
add_action( 'init', 'wpturbo_register_editorial_tag' );
			

Register an account to save your snippets or go Pro to get more features.