Make WordPress Core

Ticket #42474: 42474.1.diff

File 42474.1.diff, 1.6 KB (added by sabernhardt, 5 years ago)

simple refresh

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

     
    584584                $tax_names = get_object_taxonomies( $post );
    585585                foreach ( $tax_names as $tax_name ) {
    586586                        $taxonomy_obj = get_taxonomy( $tax_name );
    587                         if ( isset( $tax_input[ $tax_name ] ) && current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
    588                                 $new_terms = $tax_input[ $tax_name ];
    589                         } else {
    590                                 $new_terms = array();
    591                         }
     587                        if ( $taxonomy_obj->show_in_quick_edit ) {
     588                                if ( isset( $tax_input[ $tax_name ] ) && current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
     589                                        $new_terms = $tax_input[ $tax_name ];
     590                                } else {
     591                                        $new_terms = array();
     592                                }
    592593
    593                         if ( $taxonomy_obj->hierarchical ) {
    594                                 $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'ids' ) );
    595                         } else {
    596                                 $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'names' ) );
     594                                if ( $taxonomy_obj->hierarchical ) {
     595                                        $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'ids' ) );
     596                                } else {
     597                                        $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'names' ) );
     598                                }
     599
     600                                $post_data['tax_input'][ $tax_name ] = array_merge( $current_terms, $new_terms );
    597601                        }
    598 
    599                         $post_data['tax_input'][ $tax_name ] = array_merge( $current_terms, $new_terms );
    600602                }
    601603
    602604                if ( isset( $new_cats ) && in_array( 'category', $tax_names, true ) ) {