Make WordPress Core

Ticket #26948: 26948-inline-save.patch

File 26948-inline-save.patch, 991 bytes (added by meloniq, 10 years ago)

Do not update taxonomy on 'inline-save' ajax action when 'show_in_quick_edit' is set to false

  • wp-includes/post.php

     
    33913391                wp_set_post_tags( $post_ID, $postarr['tags_input'] );
    33923392        }
    33933393
     3394        $doing_inline_save = ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_POST['action'] ) && 'inline-save' == $_POST['action'] );
     3395
    33943396        // New-style support for all custom taxonomies.
    33953397        if ( ! empty( $postarr['tax_input'] ) ) {
    33963398                foreach ( $postarr['tax_input'] as $taxonomy => $tags ) {
    33973399                        $taxonomy_obj = get_taxonomy($taxonomy);
     3400                        if ( ! $taxonomy_obj || ! is_object_in_taxonomy( $post_type, $taxonomy ) ) {
     3401                                continue;
     3402                        }
     3403                       
     3404                        if ( $doing_inline_save && ! apply_filters( 'quick_edit_show_taxonomy', $taxonomy_obj->show_in_quick_edit, $taxonomy, $post_type ) ) {
     3405                                continue;
     3406                        }
    33983407                        // array = hierarchical, string = non-hierarchical.
    33993408                        if ( is_array( $tags ) ) {
    34003409                                $tags = array_filter($tags);