Custom taxonomy not showing in grid view for ‘attachment’ post type

Question

I’ve added a taxonomy called ‘colors’ to the built-in attachment post type. I can see the taxonomy when editing an item the ‘list’ view, but when using the ‘grid’ view, I can’t see/use the terms of the taxonomy.

List view:
list view

Grid view:
grid view

I want the taxonomy to show up in the grid view as well, but can’t figure out why it’s not doing that.

This is my code for registering the custom taxonomy:

function nij_register_taxonomies() {
    $taxonomy_names = array(
        'singular' => __( 'Color', 'stufig' ),
        'plural'   => __( 'Colors', 'stufig' )
    );

    register_taxonomy( strtolower($taxonomy_names['singular']),
        array('attachment'),
        array(
            'labels'            => array(
                'name'              => sprintf( _x( '%s', 'taxonomy general name', 'stufig' ), $taxonomy_names['plural'] ),
                'singular_name'     => sprintf( _x( '%s', 'taxonomy singular name', 'stufig' ), $taxonomy_names['singular'] ),
                'search_items'      => sprintf( __( 'Search %s', 'stufig' ), $taxonomy_names['plural'] ),
                'all_items'         => sprintf( __( 'All %s', 'stufig' ), $taxonomy_names['plural'] ),
                'parent_item'       => sprintf( __( 'Parent %s', 'stufig' ), $taxonomy_names['singular'] ),
                'parent_item_colon' => sprintf( __( 'Parent %s:', 'stufig' ), $taxonomy_names['singular'] ),
                'edit_item'         => sprintf( __( 'Edit %s', 'stufig' ), $taxonomy_names['singular'] ),
                'update_item'       => sprintf( __( 'Update %s', 'stufig' ), $taxonomy_names['singular'] ),
                'add_new_item'      => sprintf( __( 'Add New %s', 'stufig' ), $taxonomy_names['singular'] ),
                'new_item_name'     => sprintf( __( 'New %s Name', 'stufig' ), $taxonomy_names['singular'] ),
                'menu_name'         => sprintf( __( '%s', 'stufig' ), $taxonomy_names['plural'] )
            ),
            'public'            => false,
            'hierarchical'      => true,
            'show_ui'           => true,
            'show_admin_column' => true,
            'query_var'         => true,
            'show_in_nav_menus' => true,
            'show_tagcloud'     => false,
            'update_count_callback' => '_update_generic_term_count',
            // 'rewrite'           => array(),
        )
    );
}

add_action( 'init', 'nij_register_taxonomies', 11 );
0
, Dominique Pijnenburg 4 years 2020-03-06T07:51:50-05:00 0 Answers 90 views 0

Leave an answer

Browse
Browse