Make WordPress Core

Ticket #45343: 45343.diff

File 45343.diff, 721 bytes (added by callumbw95, 6 months ago)

Modernised patch as the previous patch wasn't working in the latest version of WordPress

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

    diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php
    index 21127dc755..13f5a0b097 100644
    a b class WP_Query { 
    32643264
    32653265                                        if ( 'ids' === $q['fields'] ) {
    32663266                                                $this->posts = $post_ids;
     3267                                                $this->post = $this->next_post() ?? null;
    32673268
    32683269                                                return $this->posts;
    32693270                                        } elseif ( 'id=>parent' === $q['fields'] ) {
    class WP_Query { 
    32853286                                                        $this->posts[] = $obj;
    32863287                                                }
    32873288
     3289                                                $this->post = $this->next_post() ?? null;
     3290
    32883291                                                return $post_parents;
    32893292                                        } else {
    32903293                                                _prime_post_caches( $post_ids, $q['update_post_term_cache'], $q['update_post_meta_cache'] );