Advertisement
riderworks

Artwork Collection Taxonomy

Oct 29th, 2020
2,405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.33 KB | None | 0 0
  1. <?php
  2. add_action( 'init', 'rg_artwork_collection_register_taxonomy' );
  3. function rg_artwork_collection_register_taxonomy() {
  4.     $labels = [
  5.         'name'                       => esc_html__( 'Collections', 'rg-artwork-collection-textdomain' ),
  6.         'singular_name'              => esc_html__( 'Collection', 'rg-artwork-collection-textdomain' ),
  7.         'menu_name'                  => esc_html__( 'Collections', 'rg-artwork-collection-textdomain' ),
  8.         'search_items'               => esc_html__( 'Search Collections', 'rg-artwork-collection-textdomain' ),
  9.         'popular_items'              => esc_html__( 'Popular Collections', 'rg-artwork-collection-textdomain' ),
  10.         'all_items'                  => esc_html__( 'All Collections', 'rg-artwork-collection-textdomain' ),
  11.         'parent_item'                => esc_html__( 'Parent Collection', 'rg-artwork-collection-textdomain' ),
  12.         'parent_item_colon'          => esc_html__( 'Parent Collection', 'rg-artwork-collection-textdomain' ),
  13.         'edit_item'                  => esc_html__( 'Edit Collection', 'rg-artwork-collection-textdomain' ),
  14.         'view_item'                  => esc_html__( 'View Collection', 'rg-artwork-collection-textdomain' ),
  15.         'update_item'                => esc_html__( 'Update Collection', 'rg-artwork-collection-textdomain' ),
  16.         'add_new_item'               => esc_html__( 'Add new collection', 'rg-artwork-collection-textdomain' ),
  17.         'new_item_name'              => esc_html__( 'New collection name', 'rg-artwork-collection-textdomain' ),
  18.         'separate_items_with_commas' => esc_html__( 'Separate collections with commas', 'rg-artwork-collection-textdomain' ),
  19.         'add_or_remove_items'        => esc_html__( 'Add or remove collections', 'rg-artwork-collection-textdomain' ),
  20.         'choose_from_most_used'      => esc_html__( 'Choose most used collections', 'rg-artwork-collection-textdomain' ),
  21.         'not_found'                  => esc_html__( 'No collections found', 'rg-artwork-collection-textdomain' ),
  22.         'no_terms'                   => esc_html__( 'No collections found', 'rg-artwork-collection-textdomain' ),
  23.         'items_list_navigation'      => esc_html__( 'Collections list pagination', 'rg-artwork-collection-textdomain' ),
  24.         'items_list'                 => esc_html__( 'Collections list', 'rg-artwork-collection-textdomain' ),
  25.         'most_used'                  => esc_html__( 'Most Used', 'rg-artwork-collection-textdomain' ),
  26.         'back_to_items'              => esc_html__( 'Back to collections', 'rg-artwork-collection-textdomain' ),
  27.         'text_domain'                => esc_html__( 'rg-artwork-collection-textdomain', 'rg-artwork-collection-textdomain' ),
  28.     ];
  29.     $args = [
  30.         'label'              => esc_html__( 'Collections', 'rg-artwork-collection-textdomain' ),
  31.         'labels'             => $labels,
  32.         'description'        => '',
  33.         'public'             => true,
  34.         'publicly_queryable' => true,
  35.         'hierarchical'       => true,
  36.         'show_ui'            => true,
  37.         'show_in_menu'       => true,
  38.         'show_in_nav_menus'  => true,
  39.         'meta_box_cb'        => true,
  40.         'show_in_rest'       => true,
  41.         'show_tagcloud'      => false,
  42.         'show_in_quick_edit' => true,
  43.         'show_admin_column'  => false,
  44.         'query_var'          => true,
  45.         'sort'               => false,
  46.         'rest_base'          => '',
  47.         'rewrite'            => [
  48.             'with_front'   => false,
  49.             'hierarchical' => false,
  50.         ],
  51.     ];
  52.     register_taxonomy( 'collection', ['artwork'], $args );
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement