WordPress.org

Make WordPress Core

Opened 8 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:

Description

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 8 years ago.
(updated: moved results filter to the end)

Download all attachments as: .zip

Change History (14)

comment:1 @kevinB8 years ago

  • Cc ryan added
  • Keywords get_pages hook added

comment:2 @kevinB8 years ago

  • Component changed from Administration to General

comment:3 @kevinB8 years ago

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

comment:4 @kevinB8 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.

@kevinB8 years ago

(updated: moved results filter to the end)

comment:5 @kevinB8 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.

comment:6 @rob1n8 years ago

  • Milestone changed from 2.2 to 2.3

comment:7 @foolswisdom8 years ago

  • Milestone changed from 2.3 to 2.5 (future)

comment:8 @rob1n7 years ago

  • Owner rob1n deleted

comment:9 @Denis-de-Bernardy6 years ago

  • Component changed from General to Template

comment:10 @Denis-de-Bernardy6 years ago

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

comment:11 @kevinB6 years ago

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

comment:12 @westi6 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

comment:13 @westi6 years ago

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