WordPress.org

Make WordPress Core

Ticket #20297: 20297.diff

File 20297.diff, 708 bytes (added by hakre, 6 years ago)
  • wp-includes/query.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress
     
    830830 *
    831831 * @since 1.5.0
    832832 */
    833 class WP_Query {
     833class WP_Query implements IteratorAggregate {
    834834
    835835        /**
    836836         * Query vars set by the user
     
    35133513                global $wp_the_query;
    35143514                return $wp_the_query === $this;
    35153515        }
     3516
     3517        /**
     3518         * Implementation of the IteratorAggregate interface (PHP 5 >= 5.0.0) <http://php.net/iteratoraggregate>
     3519         *
     3520         * @return Traversable
     3521         */
     3522        function getIterator() {
     3523                return new ArrayIterator($this->posts);
     3524        }
    35163525}
    35173526
    35183527/**