diff --git a/wp-includes/class-wp-list-util.php b/wp-includes/class-wp-list-util.php index 3648cd89f5..c394f2c613 100644 --- a/wp-includes/class-wp-list-util.php +++ b/wp-includes/class-wp-list-util.php @@ -166,8 +166,14 @@ class WP_List_Util { foreach ( $this->output as $key => $value ) { if ( is_object( $value ) ) { $newlist[ $key ] = $value->$field; - } else { + } elseif ( is_array( $value ) ) { $newlist[ $key ] = $value[ $field ]; + } else { + _doing_it_wrong( + __METHOD__, + __( 'Values for the input array must be either objects or arrays.' ), + '6.2.0' + ); } } @@ -187,12 +193,18 @@ class WP_List_Util { } else { $newlist[] = $value->$field; } - } else { + } elseif ( is_array( $value ) ) { if ( isset( $value[ $index_key ] ) ) { $newlist[ $value[ $index_key ] ] = $value[ $field ]; } else { $newlist[] = $value[ $field ]; } + } else { + _doing_it_wrong( + __METHOD__, + __( 'Values for the input array must be either objects or arrays.' ), + '6.2.0' + ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 0301dd9bfc..e0dfc0e382 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-beta3-55422'; +$wp_version = '6.2-beta3-55423'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.