Make WordPress Core

Opened 6 months ago

#60254 new enhancement

Add filter to class-wpdb.php#query that allows to return data from filter return value

Reported by: mguenter's profile mguenter Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.5
Component: Database Keywords:
Focuses: Cc:

Description

Similar to #2721, but allows not only changing the SQL query, but also the return value. In our case, we want to cache some SQL queries from third-party plugins that refuse to implement an object cache.

Here is an example of a plugin which runs a SQL query multiple times without using a cache mechanism:

https://i.imgur.com/qAF0eI5.png

I have prepared a suggestion for this, but I do not know if this covers all cases from $wpdb usage or needs some adjustments: https://gist.github.com/matzeeable/4473915b225aa1550d5da5b9b0b19b16/revisions

Change History (0)

Note: See TracTickets for help on using tickets.