Make WordPress Core

Opened 14 years ago

Closed 13 years ago

Last modified 3 years ago

#4660 closed defect (bug) (invalid)

get_pages() ignores `hierarchical' arg when a cache for a query hits

Reported by: reedom Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2.1
Component: Template Keywords: cache
Focuses: Cc:


get_pages() in post.php will shortcut if a cache for a query hits.
In that case it misses a chance to call `get_page_children()' so that it results non-hierarchical-ordered page array.


  1. create some pages hierarchical.
  2. place the attatched file test_get_pages_order.php in /wp_includes.
  3. run the script from shell.

Attachments (2)

test_get_pages_order.php (742 bytes) - added by reedom 14 years ago.
get_pages_order.2.2.1.patch (875 bytes) - added by reedom 14 years ago.
Please test well since I haven't.

Download all attachments as: .zip

Change History (6)

#1 @foolswisdom
14 years ago

  • Milestone set to 2.4 (future)

Hi Reedom, please attach a patch vs trunk.

#2 @reedom
14 years ago

I missed to mention its background.

This problem occurs only when there is one or more 'the_pages' filters and any of them change order of `$pages' array.

14 years ago

Please test well since I haven't.

#3 @darkdragon
14 years ago

  • Component changed from General to Template

#4 @DD32
13 years ago

  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

the get_page_children() call is before the wp_cache_set() call under current-day trunk, So i'm closing this ticket as invalid, as it should no longer be needed.

Note: See TracTickets for help on using tickets.