[wp-trac] [WordPress Trac] #60254: Add filter to class-wpdb.php#query that allows to return data from filter return value

WordPress Trac noreply at wordpress.org
Mon Jan 15 07:35:21 UTC 2024


#60254: Add filter to class-wpdb.php#query that allows to return data from filter
return value
-------------------------+-----------------------------
 Reporter:  mguenter     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Database     |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 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:

 [[Image(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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60254>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list