WordPress.org

Make WordPress Core

Ticket #22208: 22208.2.diff

File 22208.2.diff, 507 bytes (added by wonderboymusic, 8 years ago)
  • wp-includes/post.php

    diff --git a/wp-includes/post.php b/wp-includes/post.php
    index 03f31ef..32419d8 100644
    a b function get_children($args = '', $output = OBJECT) { 
    311311
    312312        $children = get_posts( $r );
    313313
    314         if ( !$children )
     314        if ( ! $children )
    315315                return $kids;
    316316
     317        if ( isset( $r[ 'fields' ] ) && ( $r['fields'] === 'ids' || $r['fields'] === 'id=>parent' ) )
     318                return $children;
     319       
    317320        update_post_cache($children);
    318321
    319322        foreach ( $children as $key => $child )