mirror of
git://develop.git.wordpress.org/
synced 2025-03-21 12:29:53 +01:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@52841 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7d42ae5768
commit
e4955f67c2
@ -344,7 +344,11 @@ function get_inline_data( $post ) {
|
||||
foreach ( $taxonomy_names as $taxonomy_name ) {
|
||||
$taxonomy = get_taxonomy( $taxonomy_name );
|
||||
|
||||
if ( $taxonomy->hierarchical && $taxonomy->show_ui ) {
|
||||
if ( ! $taxonomy->show_in_quick_edit ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $taxonomy->hierarchical ) {
|
||||
|
||||
$terms = get_object_term_cache( $post->ID, $taxonomy_name );
|
||||
if ( false === $terms ) {
|
||||
@ -355,7 +359,7 @@ function get_inline_data( $post ) {
|
||||
|
||||
echo '<div class="post_category" id="' . $taxonomy_name . '_' . $post->ID . '">' . implode( ',', $term_ids ) . '</div>';
|
||||
|
||||
} elseif ( $taxonomy->show_ui ) {
|
||||
} else {
|
||||
|
||||
$terms_to_edit = get_terms_to_edit( $post->ID, $taxonomy_name );
|
||||
if ( ! is_string( $terms_to_edit ) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user