Skip to content

Instantly share code, notes, and snippets.

@lgedeon
Last active August 29, 2015 14:09
Show Gist options
  • Save lgedeon/58a0fa17c533a4c20f81 to your computer and use it in GitHub Desktop.
Save lgedeon/58a0fa17c533a4c20f81 to your computer and use it in GitHub Desktop.
Taxonomy Template
<?php
namespace My\Name\Space;
function action__init() {
$namespace = "translation-namespace";
$single = __( 'Tag', $namespace );
$plural = __( 'Tags', $namespace );
register_taxonomy( 'name-space-tag', array( 'post', 'page' ), array(
'labels' => array(
'name' => $single,
'singular_name' => $plural,
'search_items' => printf( __( 'Search %s', $namespace ), $plural ),
'popular_items' => printf( __( 'Popular %s', $namespace ), $plural ),
'all_items' => printf( __( 'All %s', $namespace ), $plural ),
'parent_item' => printf( __( 'Parent %s', $namespace ), $single ),
'parent_item_colon' => printf( __( 'Parent %s:', $namespace ), $single ),
'edit_item' => printf( __( 'Edit %s', $namespace ), $single ),
'update_item' => printf( __( 'Update %s', $namespace ), $single ),
'add_new_item' => printf( __( 'Add New %s', $namespace ), $single ),
'new_item_name' => printf( __( 'New %s', $namespace ), $single ),
'separate_items_with_commas' => printf( __( 'Separate %s with commas', $namespace ), $plural ),
'add_or_remove_items' => printf( __( 'Add or remove %s', $namespace ), $plural ),
'choose_from_most_used' => printf( __( 'Choose from most used %s', $namespace ), $plural ),
'menu_name' => $plural,
),
'public' => true,
'show_in_nav_menus' => false,
'show_ui' => true,
'show_tagcloud' => false,
'show_admin_column' => false,
'hierarchical' => true,
'rewrite' => false,
'query_var' => false,
) );
}
add_action( 'init', __NAMESPACE__ . '\action__init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment