riderworks

Artwork Size Taxonomy

Oct 29th, 2020
1,045
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. add_action( 'init', 'rg_artwork_sizes_register_taxonomy' );
  3. function rg_artwork_sizes_register_taxonomy() {
  4.     $labels = [
  5.         'name'                       => esc_html__( 'Sizes', 'rg-artwork-sizes-textdomain' ),
  6.         'singular_name'              => esc_html__( 'Size', 'rg-artwork-sizes-textdomain' ),
  7.         'menu_name'                  => esc_html__( 'Sizes', 'rg-artwork-sizes-textdomain' ),
  8.         'search_items'               => esc_html__( 'Search Sizes', 'rg-artwork-sizes-textdomain' ),
  9.         'popular_items'              => esc_html__( 'Popular Sizes', 'rg-artwork-sizes-textdomain' ),
  10.         'all_items'                  => esc_html__( 'All Sizes', 'rg-artwork-sizes-textdomain' ),
  11.         'parent_item'                => esc_html__( 'Parent Size', 'rg-artwork-sizes-textdomain' ),
  12.         'parent_item_colon'          => esc_html__( 'Parent Size', 'rg-artwork-sizes-textdomain' ),
  13.         'edit_item'                  => esc_html__( 'Edit Size', 'rg-artwork-sizes-textdomain' ),
  14.         'view_item'                  => esc_html__( 'View Size', 'rg-artwork-sizes-textdomain' ),
  15.         'update_item'                => esc_html__( 'Update Size', 'rg-artwork-sizes-textdomain' ),
  16.         'add_new_item'               => esc_html__( 'Add new size', 'rg-artwork-sizes-textdomain' ),
  17.         'new_item_name'              => esc_html__( 'New size name', 'rg-artwork-sizes-textdomain' ),
  18.         'separate_items_with_commas' => esc_html__( 'Separate sizes with commas', 'rg-artwork-sizes-textdomain' ),
  19.         'add_or_remove_items'        => esc_html__( 'Add or remove sizes', 'rg-artwork-sizes-textdomain' ),
  20.         'choose_from_most_used'      => esc_html__( 'Choose most used sizes', 'rg-artwork-sizes-textdomain' ),
  21.         'not_found'                  => esc_html__( 'No sizes found', 'rg-artwork-sizes-textdomain' ),
  22.         'no_terms'                   => esc_html__( 'No sizes found', 'rg-artwork-sizes-textdomain' ),
  23.         'items_list_navigation'      => esc_html__( 'Sizes list pagination', 'rg-artwork-sizes-textdomain' ),
  24.         'items_list'                 => esc_html__( 'Sizes list', 'rg-artwork-sizes-textdomain' ),
  25.         'most_used'                  => esc_html__( 'Most Used', 'rg-artwork-sizes-textdomain' ),
  26.         'back_to_items'              => esc_html__( 'Back to sizes', 'rg-artwork-sizes-textdomain' ),
  27.         'text_domain'                => esc_html__( 'rg-artwork-sizes-textdomain', 'rg-artwork-sizes-textdomain' ),
  28.     ];
  29.     $args = [
  30.         'label'              => esc_html__( 'Sizes', 'rg-artwork-sizes-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( 'size', ['[object Object]', '[object Object]', '[object Object]', '[object Object]', '[object Object]', '[object Object]', '[object Object]', '[object Object]', '[object Object]', '[object Object]', '[object Object]', '[object Object]', 'artwork'], $args );
  53. }
RAW Paste Data