johnbillion / extended-cpts

A library which provides extended functionality to WordPress custom post types and taxonomies.
GNU General Public License v2.0
979 stars 96 forks source link

Warning for taxonomy filter in admin UI #75

Closed dmpinder closed 7 years ago

dmpinder commented 7 years ago

I'm trying to include an admin_filter in my CPT for a taxo set up. I'm getting this warning:

Warning: The "Walker_ExtendedTaxonomyDropdown" class is required in order to display taxonomy filters in /app/vendor/johnbillion/extended-cpts/src/class-extended-cpt-admin.php on line 217

Here's my file:

<?php
$downloads = register_extended_post_type( 'downloads', array(

    # Add the post type to the site's main RSS feed:
    'show_in_feed' => true,

    'menu_icon' => 'dashicons-download',

    # Add some custom columns to the admin screen:
    'admin_cols' => array(
        'title' => array(),
        'file_name' => array(
            'title'       => 'File Name',
            'post_field'    => 'file_name',
        ),
        'category' => array(
            'taxonomy' => 'download_category'
        )
    ),

    'supports' => array('author'),

    # Add a dropdown filter to the admin screen:
    'admin_filters' => array(
        'download_category' => array(
            'title'    => 'Category',
            'taxonomy' => 'download_category',
        ),
    ),

), array(

    # Override the base names used for labels:
    'singular' => 'Download',
    'plural'   => 'Downloads',
    'slug'     => 'download',
) );

$downloads->add_taxonomy( 'download_category', array(
# Use radio buttons in the meta box for this taxonomy on the post editing screen:
//'meta_box' => 'checkbox',

# Show this taxonomy in the 'At a Glance' dashboard widget:
    'dashboard_glance' => true,

# Add a custom column to the admin screen:
    'admin_cols'       => array(
        'updated' => array(
            'title'       => 'Updated',
            'meta_key'    => 'updated_date',
            'date_format' => 'd/m/Y'
        ),
    ),

), array(

# Override the base names used for labels:
        'singular' => 'Category',
        'plural'   => 'Categories',
        'slug'     => 'download_category'

    )
);

Any idea what I'm doing wrong? I'm using just the Extended CPT lib.

Thanks!

johnbillion commented 7 years ago

That's a bug! Thanks. Fix coming up.

johnbillion commented 7 years ago

Fixed in 4.0.1.