Skip to content

Instantly share code, notes, and snippets.

@thomasmery
Created July 26, 2014 10:45
Show Gist options
  • Save thomasmery/78f8633e04fec2739d31 to your computer and use it in GitHub Desktop.
Save thomasmery/78f8633e04fec2739d31 to your computer and use it in GitHub Desktop.
<?php
function media_category_init() {
register_taxonomy( 'media-category', array( 'attachment' ), array(
'hierarchical' => true,
'public' => true,
'show_in_nav_menus' => true,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => true,
'capabilities' => array(
'manage_terms' => 'edit_posts',
'edit_terms' => 'edit_posts',
'delete_terms' => 'edit_posts',
'assign_terms' => 'edit_posts'
),
'labels' => array(
'name' => __( 'Media Categories', 'stances' ),
'singular_name' => _x( 'Media Category', 'taxonomy general name', 'stances' ),
'search_items' => __( 'Search Media Categories', 'stances' ),
'popular_items' => __( 'Popular Media Categories', 'stances' ),
'all_items' => __( 'All Media Categories', 'stances' ),
'parent_item' => __( 'Parent Media Category', 'stances' ),
'parent_item_colon' => __( 'Parent Media Category:', 'stances' ),
'edit_item' => __( 'Edit Media Category', 'stances' ),
'update_item' => __( 'Update Media Category', 'stances' ),
'add_new_item' => __( 'New Media Category', 'stances' ),
'new_item_name' => __( 'New Media Category', 'stances' ),
'separate_items_with_commas' => __( 'Media Categoris separated by comma', 'stances' ),
'add_or_remove_items' => __( 'Add or remove Media Categories', 'stances' ),
'choose_from_most_used' => __( 'Choose from the most used Media Categories', 'stances' ),
'menu_name' => __( 'Media Categories', 'stances' ),
),
) );
}
add_action( 'init', 'media_category_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment