Make WordPress Core

Opened 9 years ago

Closed 6 years ago

#4094 closed enhancement (invalid)

get_pages: add query hooks, wpcache argument hooks

Reported by: kevinB Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Template Keywords: needs-patch get_pages hook
Focuses: Cc:


To support plugins which want to do query filtering and/or use alternate wp_cache id and group (Note that the existing results filter already lets plugins have their way with results set. This just lets them do it more efficiently).

  • Add wpcache_id and wpcache_group filters
  • Add join, where, request filters
  • apply existing results filter prior to cache update

Attachments (1)

get_pages-hooks.diff (2.4 KB) - added by kevinB 9 years ago.
(updated: moved results filter to the end)

Download all attachments as: .zip

Change History (14)

#1 @kevinB
9 years ago

  • Cc ryan added
  • Keywords get_pages hook added

#2 @kevinB
9 years ago

  • Component changed from Administration to General

#3 @kevinB
9 years ago

also posted tickets for get_bookmarks(#4095) and get_categories(#4096)

#4 @kevinB
9 years ago

correction: the existing results filter is already applied prior to cache update. Tickets #4095 and #4096 propose changing get_bookmarks and get_categories to do the same.

9 years ago

(updated: moved results filter to the end)

#5 @kevinB
9 years ago

I've come to some clearer thinking on the results filter placement.

If the cache retrieval is run through the same filter, there is no need to filter prior to cache storage. It seems safer to leave the actual cache storage unfiltered so it's not invalid after a filtering plugin is removed.

That means get_pages is the one that should change.

In fact, there is a defect in the current code:
The current placement of the post-query "get_pages" filter causes get_page_children contributions to be filtered on cache retrieval, but not after query. End user could get a different answer the first time they ask.

#6 @rob1n
9 years ago

  • Milestone changed from 2.2 to 2.3

#7 @foolswisdom
8 years ago

  • Milestone changed from 2.3 to 2.5 (future)

#8 @rob1n
8 years ago

  • Owner rob1n deleted

#9 @Denis-de-Bernardy
6 years ago

  • Component changed from General to Template

#10 @Denis-de-Bernardy
6 years ago

  • Keywords needs-patch added
  • Milestone changed from 2.9 to Future Release

#11 @kevinB
6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

#12 @westi
6 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

#13 @westi
6 years ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.