Make WordPress Core

Ticket #59785: 59785-fix-fatal-error-attempt-to-assign-property-object_id-on-bool.diff

File 59785-fix-fatal-error-attempt-to-assign-property-object_id-on-bool.diff, 682 bytes (added by gliautard, 8 months ago)

Hello, I can confirm this solved a problem we had on a multisite instance. Thanks!

  • src/wp-includes/class-wp-term-query.php

    diff --git src/wp-includes/class-wp-term-query.php src/wp-includes/class-wp-term-query.php
    index 25baaa8dd1..c71c610942 100644
    class WP_Term_Query { 
    11301130                foreach ( $terms as $key => $term_data ) {
    11311131                        if ( is_object( $term_data ) && property_exists( $term_data, 'term_id' ) ) {
    11321132                                $term = get_term( $term_data->term_id );
    1133                                 if ( property_exists( $term_data, 'object_id' ) ) {
     1133                                if ( is_object( $term ) && property_exists( $term_data, 'object_id' ) ) {
    11341134                                        $term->object_id = (int) $term_data->object_id;
    11351135                                }
    11361136                                if ( property_exists( $term_data, 'count' ) ) {