[wp-trac] [WordPress Trac] #10230: get_pages function: number and child_of parameters conflict

WordPress Trac noreply at wordpress.org
Thu Sep 11 15:24:52 UTC 2025


#10230: get_pages function: number and child_of parameters conflict
-------------------------------+-------------------------
 Reporter:  ortsaipekim        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  2.8
 Severity:  normal             |  Resolution:  worksforme
 Keywords:  needs-refresh      |     Focuses:  template
-------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:  has-patch needs-testing needs-refresh => needs-refresh
 * status:  assigned => closed
 * resolution:   => worksforme


Comment:

 == Reproduction Report
 === Description
 ❌ This report can't validates that the issue can be reproduced anymore

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.29
 - Server: nginx/1.29.1
 - Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
 - Browser: Chrome 139.0.0.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Three 1.6
 - MU Plugins: None activated
 - Plugins:
   * BBB Testing Dolly
   * Test Reports 1.2.0

 === Testing Instrutions
 1. Added the structure of Parent/Childs as in OP
 2. Used the snippet provided in Supp Artifacts
 3. 👌 Two Childs are shown as expected

 [[Image(https://i.imgur.com/w4RkYXf.png)]]

 === Actual Results
 1. ❌ Error condition is not occurring

 === Additional Notes
 - Things have changed significantly for the past years and the function
 does not look not even close to what it used to look when patch was
 released. For this reason I have to close this as `worksforme`

 === Supplemental Artifacts

 {{{
 function test_get_pages() {
     $parent3_id = 161;
     $pages = get_pages(array(
         'number' => 2,
         'child_of' => $parent3_id,
     ));

     echo '<pre>';
     if (!empty($pages)) {
         foreach ($pages as $page) {
             echo 'Title: ' . $page->post_title . "\n";
         }
     } else {
         echo 'No pages found.';
     }
     echo '</pre>';
 }
 add_action('wp_footer', 'test_get_pages');
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/10230#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list