Skip to content

Instantly share code, notes, and snippets.

/functions.php Secret

Created October 25, 2013 17:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5267905cccae4d52cc1b to your computer and use it in GitHub Desktop.
Save anonymous/5267905cccae4d52cc1b to your computer and use it in GitHub Desktop.
<?php
add_action( 'init', 'aahank_register_taxonomies', 0 );
function aahank_register_taxonomies() {
// Taxonomy: List
// For Post Type: Bookmark
register_taxonomy(
'aahank_list', // Unique name for the taxonomy
array( 'aahank_bookmark' ), // Attach to post type(s)
array( // Arguments
'labels' => array(
'name' => _x( 'Lists', 'taxonomy general name' ),
'singular_name' => _x( 'List', 'taxonomy singular name' ),
'menu_name' => __( 'Lists' ),
'search_items' => __( 'Search Lists' ),
'popular_items' => __( 'Popular Lists' ),
'all_items' => __( 'All Lists' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit List' ),
'view_item' => __( 'View List' ),
'update_item' => __( 'Update List' ),
'add_new_item' => __( 'Add New List' ),
'new_item_name' => __( 'New List Name' ),
'separate_items_with_commas' => __( 'Separate lists with commas' ),
'add_or_remove_items' => __( 'Add or remove lists' ),
'choose_from_most_used' => __( 'Choose from the most used lists' ),
'not_found' => __( 'No lists found.' ),
),
'public' => true,
'show_ui' => true,
'show_in_nav_menus' => false,
'show_admin_column' => true,
'hierarchical' => false,
'query_var' => 'list', // site/?list=entertainment
'rewrite' => array(
'slug' => 'bookmarks/lists',
'with_front' => false,
'hierarchical' => false,
),
'_builtin' => false,
)
);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment