Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'init', 'rg_artwork_collection_register_taxonomy' );
- function rg_artwork_collection_register_taxonomy() {
- $labels = [
- 'name' => esc_html__( 'Collections', 'rg-artwork-collection-textdomain' ),
- 'singular_name' => esc_html__( 'Collection', 'rg-artwork-collection-textdomain' ),
- 'menu_name' => esc_html__( 'Collections', 'rg-artwork-collection-textdomain' ),
- 'search_items' => esc_html__( 'Search Collections', 'rg-artwork-collection-textdomain' ),
- 'popular_items' => esc_html__( 'Popular Collections', 'rg-artwork-collection-textdomain' ),
- 'all_items' => esc_html__( 'All Collections', 'rg-artwork-collection-textdomain' ),
- 'parent_item' => esc_html__( 'Parent Collection', 'rg-artwork-collection-textdomain' ),
- 'parent_item_colon' => esc_html__( 'Parent Collection', 'rg-artwork-collection-textdomain' ),
- 'edit_item' => esc_html__( 'Edit Collection', 'rg-artwork-collection-textdomain' ),
- 'view_item' => esc_html__( 'View Collection', 'rg-artwork-collection-textdomain' ),
- 'update_item' => esc_html__( 'Update Collection', 'rg-artwork-collection-textdomain' ),
- 'add_new_item' => esc_html__( 'Add new collection', 'rg-artwork-collection-textdomain' ),
- 'new_item_name' => esc_html__( 'New collection name', 'rg-artwork-collection-textdomain' ),
- 'separate_items_with_commas' => esc_html__( 'Separate collections with commas', 'rg-artwork-collection-textdomain' ),
- 'add_or_remove_items' => esc_html__( 'Add or remove collections', 'rg-artwork-collection-textdomain' ),
- 'choose_from_most_used' => esc_html__( 'Choose most used collections', 'rg-artwork-collection-textdomain' ),
- 'not_found' => esc_html__( 'No collections found', 'rg-artwork-collection-textdomain' ),
- 'no_terms' => esc_html__( 'No collections found', 'rg-artwork-collection-textdomain' ),
- 'items_list_navigation' => esc_html__( 'Collections list pagination', 'rg-artwork-collection-textdomain' ),
- 'items_list' => esc_html__( 'Collections list', 'rg-artwork-collection-textdomain' ),
- 'most_used' => esc_html__( 'Most Used', 'rg-artwork-collection-textdomain' ),
- 'back_to_items' => esc_html__( 'Back to collections', 'rg-artwork-collection-textdomain' ),
- 'text_domain' => esc_html__( 'rg-artwork-collection-textdomain', 'rg-artwork-collection-textdomain' ),
- ];
- $args = [
- 'label' => esc_html__( 'Collections', 'rg-artwork-collection-textdomain' ),
- 'labels' => $labels,
- 'description' => '',
- 'public' => true,
- 'publicly_queryable' => true,
- 'hierarchical' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_nav_menus' => true,
- 'meta_box_cb' => true,
- 'show_in_rest' => true,
- 'show_tagcloud' => false,
- 'show_in_quick_edit' => true,
- 'show_admin_column' => false,
- 'query_var' => true,
- 'sort' => false,
- 'rest_base' => '',
- 'rewrite' => [
- 'with_front' => false,
- 'hierarchical' => false,
- ],
- ];
- register_taxonomy( 'collection', ['artwork'], $args );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement