Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Custom Taxonomy
- */
- // Custom taxonomy for media attachments, acts like Categories
- function kebo_create_image_taxonomy()
- {
- // Add new taxonomy, make it hierarchical (like categories)
- $labels = array(
- 'name' => _x( 'Categories', 'kebo' ),
- 'singular_name' => _x( 'Category', 'kebo' ),
- 'search_items' => __( 'Search Categories' ),
- 'all_items' => __( 'All Categories' ),
- 'parent_item' => __( 'Parent Category' ),
- 'parent_item_colon' => __( 'Parent Category:' ),
- 'edit_item' => __( 'Edit Category' ),
- 'update_item' => __( 'Update Category' ),
- 'add_new_item' => __( 'Add New Category' ),
- 'new_item_name' => __( 'New Category Name' ),
- 'menu_name' => __( 'Categories' )
- );
- $args = array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'query_var' => true,
- 'show_in_nav_menus' => false,
- 'show_tagcloud' => false,
- 'rewrite' => array(
- 'slug' => 'media-category',
- 'with_front' => false,
- )
- );
- register_taxonomy( 'media-category', 'attachment', $args );
- }
- add_action( 'init', 'kebo_create_image_taxonomy' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement