Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'init', 'irw_colors_register_taxonomy' );
- function irw_colors_register_taxonomy() {
- $labels = [
- 'name' => esc_html__( 'Colors', 'monicaarts' ),
- 'singular_name' => esc_html__( 'Color', 'monicaarts' ),
- 'menu_name' => esc_html__( 'Colors', 'monicaarts' ),
- 'search_items' => esc_html__( 'Search Colors', 'monicaarts' ),
- 'popular_items' => esc_html__( 'Popular Colors', 'monicaarts' ),
- 'all_items' => esc_html__( 'All Colors', 'monicaarts' ),
- 'parent_item' => esc_html__( 'Parent Color', 'monicaarts' ),
- 'parent_item_colon' => esc_html__( 'Parent Color', 'monicaarts' ),
- 'edit_item' => esc_html__( 'Edit Color', 'monicaarts' ),
- 'view_item' => esc_html__( 'View Color', 'monicaarts' ),
- 'update_item' => esc_html__( 'Update Color', 'monicaarts' ),
- 'add_new_item' => esc_html__( 'Add new color', 'monicaarts' ),
- 'new_item_name' => esc_html__( 'New color name', 'monicaarts' ),
- 'separate_items_with_commas' => esc_html__( 'Separate colors with commas', 'monicaarts' ),
- 'add_or_remove_items' => esc_html__( 'Add or remove colors', 'monicaarts' ),
- 'choose_from_most_used' => esc_html__( 'Choose most used colors', 'monicaarts' ),
- 'not_found' => esc_html__( 'No colors found', 'monicaarts' ),
- 'no_terms' => esc_html__( 'No colors found', 'monicaarts' ),
- 'items_list_navigation' => esc_html__( 'Colors list pagination', 'monicaarts' ),
- 'items_list' => esc_html__( 'Colors list', 'monicaarts' ),
- 'most_used' => esc_html__( 'Most Used', 'monicaarts' ),
- 'back_to_items' => esc_html__( 'Back to colors', 'monicaarts' ),
- 'text_domain' => esc_html__( 'monicaarts', 'monicaarts' ),
- ];
- $args = [
- 'label' => esc_html__( 'Colors', 'monicaarts' ),
- 'labels' => $labels,
- 'description' => '',
- 'public' => true,
- 'publicly_queryable' => true,
- 'hierarchical' => false,
- '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( 'color', ['design'], $args );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement