Make WordPress Core

Ticket #50463: 50463.diff

File 50463.diff, 852 bytes (added by Chouby, 4 years ago)
  • src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php

    diff --git a/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php b/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php
    index 54e83e913b..3ec20bf23f 100644
    a b class WP_Sitemaps_Posts extends WP_Sitemaps_Provider { 
    9292
    9393                $query = new WP_Query( $args );
    9494
    95                 /**
    96                  * Returns an array of posts.
    97                  *
    98                  * @var array<int, \WP_Post> $posts
    99                  */
    100                 $posts = $query->get_posts();
    101 
    10295                $url_list = array();
    10396
    10497                /*
    class WP_Sitemaps_Posts extends WP_Sitemaps_Provider { 
    122115                        $url_list[]    = $sitemap_entry;
    123116                }
    124117
    125                 foreach ( $posts as $post ) {
     118                foreach ( $query->posts as $post ) {
    126119                        $sitemap_entry = array(
    127120                                'loc' => get_permalink( $post ),
    128121                        );