WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 6 years ago

#4095 closed enhancement (invalid)

get_bookmarks: add query hooks, wpcache argument hooks

Reported by: kevinB Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Template Keywords: needs-patch get_bookmarks 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_bookmarks-hooks.diff (1.5 KB) - added by kevinB 8 years ago.
(updated to restore results filter placement to the end)

Download all attachments as: .zip

Change History (14)

comment:1 @kevinB8 years ago

also posted tickets for get_pages(#4094) and get_categories(#4096)

@kevinB8 years ago

(updated to restore results filter placement to the end)

comment:2 @kevinB8 years ago

I've come to some clearer thinking on the results filter placement and reverted my previous proposal to move it.

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.

comment:3 follow-up: @ryan8 years ago

Why do the cache id and group need to be run through a filter? The cache key changing arbitrarily as plugins are activated doesn't seem useful.

comment:4 in reply to: ↑ 3 @kevinB8 years ago

Replying to ryan:

Why do the cache id and group need to be run through a filter? The cache key changing arbitrarily as plugins are activated doesn't seem useful.

Because I want to implement user groups and group-specific capabilities per page. I need the hooks to do query filtering, but that does me no good if wp_cache is short-circuiting each request to (anybody's) last results set. I need to maintain my own separate cache for each user group. Adding the requested hooks would let me do it without messing with the default wp_cache contents.

comment:5 @kevinB8 years ago

In my last response I was talking "pages", but this pertains to bookmarks and categories too.

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 @rob1n8 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.