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

Taxonomy config not respected in quick edit #133

Closed matbrady closed 3 years ago

matbrady commented 4 years ago

Problem

Defining a custom Taxonomy with the below configuration is not respected by the Post list view 'quick edit' screen. My expectation is that in quick edit screen, radio buttons would also appear and only 1 term could be selected.

<?php

add_action('init', function () {

    register_extended_taxonomy('format', array('post', 'page'), array(

        'description' => 'The type of format',

        'meta_box' => 'radio',

        'exclusive' => true,

        'settings' => array(
            'show_in_nav_menus' => true,
            'show_ui' => true,
            'show_in_quick_edit' => true,
            'meta_box_cb' => false,
        ),

    ), array(

        # Override the base names used for labels:
        'singular' => 'Format',
        'plural' => 'Formats',
        'slug' => 'format',

    ));

});

Admin Page Edit Screen

Radio buttons appear as expected and only one can be selected.

Admin Pages List View

Checkboxes appear and more then one term can be applied. After saving, in the edit screen above, the last term is chosen a being selected. However, there are actually still multiple terms applied to the Page.

johnbillion commented 4 years ago

Thanks for the report! I must say that I almost always disable Quick Edit for custom post types, but I will still look into what's involved in supporting this.

johnbillion commented 3 years ago

I just looked into this and it's not possible to target the Walker class that's used for this list of terms without affecting all other uses of wp_terms_checklist(), which isn't desirable because that would affect features such as filters on the front end.

As much as I'm tempted to put a patch into WordPress core that allows for this, I'm not too enthusiastic to be honest. I recommend disabling Quick Edit for this post type.