Make WordPress Core

Ticket #42474: 42474.2.diff

File 42474.2.diff, 1.6 KB (added by costdev, 3 years ago)

Patch refreshed against trunk.

  • src/wp-admin/includes/post.php

    diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php
    index c9b29b5df4..4be0ef4a43 100644
    a b function bulk_edit_posts( $post_data = null ) { 
    599599                $tax_names = get_object_taxonomies( $post );
    600600                foreach ( $tax_names as $tax_name ) {
    601601                        $taxonomy_obj = get_taxonomy( $tax_name );
    602                         if ( isset( $tax_input[ $tax_name ] ) && current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
    603                                 $new_terms = $tax_input[ $tax_name ];
    604                         } else {
    605                                 $new_terms = array();
    606                         }
     602                        if ( $taxonomy_obj->show_in_quick_edit ) {
     603                                if ( isset( $tax_input[ $tax_name ] ) && current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
     604                                        $new_terms = $tax_input[ $tax_name ];
     605                                } else {
     606                                        $new_terms = array();
     607                                }
    607608
    608                         if ( $taxonomy_obj->hierarchical ) {
    609                                 $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'ids' ) );
    610                         } else {
    611                                 $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'names' ) );
    612                         }
     609                                if ( $taxonomy_obj->hierarchical ) {
     610                                        $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'ids' ) );
     611                                } else {
     612                                        $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'names' ) );
     613                                }
    613614
    614                         $post_data['tax_input'][ $tax_name ] = array_merge( $current_terms, $new_terms );
     615                                $post_data['tax_input'][ $tax_name ] = array_merge( $current_terms, $new_terms );
     616                        }
    615617                }
    616618
    617619                if ( isset( $new_cats ) && in_array( 'category', $tax_names, true ) ) {