[wp-trac] [WordPress Trac] #49701: Quick Edit fails to populate taxonomy terms when show_in_quick_edit = true, and show_ui = false
WordPress Trac
noreply at wordpress.org
Thu Mar 10 18:19:33 UTC 2022
#49701: Quick Edit fails to populate taxonomy terms when show_in_quick_edit = true,
and show_ui = false
-----------------------------+---------------------
Reporter: figureone | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.0
Component: Quick/Bulk Edit | Version: 5.4
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+---------------------
Changes (by SergeyBiryukov):
* milestone: Awaiting Review => 6.0
Old description:
> Aloha, we discovered that the `show_in_quick_edit` property is not being
> checked when populating a post's taxonomy terms in `/wp-admin/edit.php`.
> As a consequence, if `show_in_quick_edit` is true, but `show_ui` is false
> for a given taxonomy, the Quick Edit UI will not check any of the term
> checkboxes, which can result in losing existing terms when a post is
> updated via Quick Edit.
>
> Likely this was just an oversight when `show_in_quick_edit` was
> introduced here:
> https://core.trac.wordpress.org/changeset/31307
>
> And it should be an easy fix to check `show_in_quick_edit` instead of
> `show_ui` here:
> https://github.com/WordPress/WordPress/blob/5.3.2/wp-
> admin/includes/template.php#L343
> https://github.com/WordPress/WordPress/blob/5.3.2/wp-
> admin/includes/template.php#L354
>
> `show_in_quick_edit` defaults to the value of `show_ui` if it isn't
> specified, so this change shouldn't introduce any issues.
> https://github.com/WordPress/WordPress/blob/5.3.2/wp-includes/class-wp-
> taxonomy.php#L334
>
> Our use case:
> We have a taxonomy and terms defined in a plugin that is not meant to be
> edited in the WordPress UI. However, we do want users to be able to
> assign taxonomy terms to posts in the Quick Edit UI.
>
> Extra details if needed:
> When clicking the Quick Edit button, `inline-edit-post.js` refers to the
> term divs to mark the correct checkboxes:
> https://github.com/WordPress/WordPress/blob/5.3.2/wp-admin/js/inline-
> edit-post.js#L305-L316
> Term divs are echoed here:
> https://github.com/WordPress/WordPress/blob/5.3.2/wp-
> admin/includes/template.php#L343-L364
New description:
Aloha, we discovered that the `show_in_quick_edit` property is not being
checked when populating a post's taxonomy terms in `/wp-admin/edit.php`.
As a consequence, if `show_in_quick_edit` is true, but `show_ui` is false
for a given taxonomy, the Quick Edit UI will not check any of the term
checkboxes, which can result in losing existing terms when a post is
updated via Quick Edit.
Likely this was just an oversight when `show_in_quick_edit` was introduced
here:
[31307].
And it should be an easy fix to check `show_in_quick_edit` instead of
`show_ui` here:
https://github.com/WordPress/WordPress/blob/5.3.2/wp-
admin/includes/template.php#L343
https://github.com/WordPress/WordPress/blob/5.3.2/wp-
admin/includes/template.php#L354
`show_in_quick_edit` defaults to the value of `show_ui` if it isn't
specified, so this change shouldn't introduce any issues.
https://github.com/WordPress/WordPress/blob/5.3.2/wp-includes/class-wp-
taxonomy.php#L334
Our use case:
We have a taxonomy and terms defined in a plugin that is not meant to be
edited in the WordPress UI. However, we do want users to be able to assign
taxonomy terms to posts in the Quick Edit UI.
Extra details if needed:
When clicking the Quick Edit button, `inline-edit-post.js` refers to the
term divs to mark the correct checkboxes:
https://github.com/WordPress/WordPress/blob/5.3.2/wp-admin/js/inline-edit-
post.js#L305-L316
Term divs are echoed here:
https://github.com/WordPress/WordPress/blob/5.3.2/wp-
admin/includes/template.php#L343-L364
--
Comment:
Hi there, welcome back to WordPress Trac!
Thanks for the ticket, sorry it took so long for someone to get back to
you.
The patch does fix the issue in my testing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49701#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list