|
<?php |
|
/** |
|
* Register WordPress tags for posts of the attachment post type, register other custom taxonomies as well |
|
*/ |
|
function sjf_deh_taxonomies() { |
|
|
|
// allow tags to apply to posts of the attachment post_type |
|
register_taxonomy_for_object_type( 'post_tag', 'attachment' ); |
|
|
|
// Add new taxonomy, make it hierarchical (like categories) |
|
$labels = array( |
|
'name' => _x( 'Skiers', 'taxonomy general name' ), |
|
'singular_name' => _x( 'Skier', 'taxonomy singular name' ), |
|
'search_items' => __( 'Search Skiers' ), |
|
'all_items' => __( 'All Skiers' ), |
|
'parent_item' => __( 'Parent Skier' ), |
|
'parent_item_colon' => __( 'Parent Skier:' ), |
|
'edit_item' => __( 'Edit Skier' ), |
|
'update_item' => __( 'Update Skier' ), |
|
'add_new_item' => __( 'Add New Skier' ), |
|
'new_item_name' => __( 'New Skier Name' ), |
|
'menu_name' => __( 'Skiers' ), |
|
); |
|
|
|
$args = array( |
|
'hierarchical' => false, |
|
'labels' => $labels, |
|
'show_ui' => true, |
|
'show_admin_column' => true, |
|
'query_var' => true, |
|
'rewrite' => array( 'slug' => 'skiers' ), |
|
); |
|
|
|
register_taxonomy( 'skier', array( 'attachment' ), $args ); |
|
|
|
} |
|
add_action( 'init', 'sjf_deh_taxonomies', 0 ); |