WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/29/2013 03:07:59 PM (8 years ago)
Author:
wonderboymusic
Message:

Respect the fields arg when passed to get_children().

Fixes #22208.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/tests/post/getPages.php

    r25002 r25160  
    118118        $this->assertEquals( 5, count( $matches[0] ) );
    119119    }
     120
     121    /**
     122     * @ticket 22208
     123     */
     124    function test_get_chidren_fields_ids() {
     125        $post_id = $this->factory->post->create();
     126        $child_ids = $this->factory->post->create_many( 5, array( 'post_parent' => $post_id ) );
     127
     128        $post_ids = get_children( array( 'fields' => 'ids', 'post_parent' => $post_id ) );
     129        $this->assertEqualSets( $child_ids, $post_ids );
     130    }
    120131}
Note: See TracChangeset for help on using the changeset viewer.