Make WordPress Core

Ticket #40351: 40351.5.patch

File 40351.5.patch, 668 bytes (added by lcyh78, 5 years ago)

Alternative fix proposed. Seems problem occurs as parameter $taxonomy is changed to an object a few lines earlier. This does as in wp_set_object_terms and wp_remove_object_terms.

  • taxonomy.php

     
    34333433                return false;
    34343434        }
    34353435
    3436         $taxonomy = get_taxonomy( $taxonomy );
    3437         if ( ! empty( $taxonomy->update_count_by_callback ) ) {
    3438                 call_user_func( $taxonomy->update_count_by_callback, $tt_ids, $taxonomy, $modify_by );
     3436        $taxonomy_object = get_taxonomy( $taxonomy );
     3437        if ( ! empty( $taxonomy_object->update_count_by_callback ) ) {
     3438                call_user_func( $taxonomy_object->update_count_by_callback, $tt_ids, $taxonomy_object, $modify_by );
    34393439                clean_term_cache( $tt_ids, '', false );
    34403440                return true;
    34413441        }