Make WordPress Core

Opened 7 years ago

Closed 3 years ago

#42916 closed defect (bug) (fixed)

Terms for taxonomy with show_in_quick_edit = false still load in inline data

Reported by: jazbek's profile jazbek Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.0 Priority: normal
Severity: normal Version: 4.9.1
Component: Quick/Bulk Edit Keywords: has-patch needs-testing
Focuses: performance Cc:

Description (last modified by SergeyBiryukov)

The show_in_quick_edit property was introduced for taxonomies in 4.2 with changeset: [31307].

This changeset removed the taxonomy from the inline edit form, but the terms for the taxonomy are still being populated in the data for each row via the get_inline_data() function, which only respects $taxonomy->show_ui.

One reason people may want to remove a taxonomy from quick edit is for performance reasons, when the number of terms fore each post are huge. However, the terms are still being loaded, and the page can take a huge performance hit.

For example, I have a custom post type where each one is assigned thousands of zip codes via a custom taxonomy. I set show_in_quick_edit to false on the taxonomy, but the post listing was still loading very slow. I looked at the source code, and saw thousands of zip codes being rendered in a hidden div on each row.

Attachments (1)

patch.diff (944 bytes) - added by jazbek 7 years ago.

Download all attachments as: .zip

Change History (8)

@jazbek
7 years ago

#1 @sabernhardt
5 years ago

  • Component changed from Administration to Quick/Bulk Edit

Related/duplicate: #49701

(A more recent ticket proposes the same two changes for /wp-admin/includes/template.php)

#2 @ovidiul
3 years ago

#55144 was marked as a duplicate.

#3 @sabernhardt
3 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 6.0

The patch still applies cleanly to src, but I have not (yet) confirmed whether it fixes the issue.

This ticket was mentioned in Slack in #core by abhanonstopnews. View the logs.


3 years ago

#5 @SergeyBiryukov
3 years ago

  • Description modified (diff)

#6 @SergeyBiryukov
3 years ago

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.

#7 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 52841:

Quick/Bulk Edit: Check the show_in_quick_edit taxonomy property when populating the data for the posts list table.

Previously, setting the show_in_quick_edit property to false removed the taxonomy from the inline edit form, but the terms were still being populated in the data for each table row via the get_inline_data() function, which only checked the $taxonomy->show_ui property.

This commit:

  • Improves performance by ensuring that taxonomy terms are not unnecessarily populated for each table row when show_in_quick_edit is false.
  • Properly populates the taxonomy terms when show_in_quick_edit is true and show_ui is false.

Follow-up to [31307].

Props jazbek, figureone, sabernhardt, ovidiul, webcommsat, SergeyBiryukov.
Fixes #42916, #49701.

Note: See TracTickets for help on using tickets.