[wp-trac] [WordPress Trac] #29710: Add hooks to wpdb's insert(), update(), delete() and similar methods

WordPress Trac noreply at wordpress.org
Tue Sep 30 09:22:01 UTC 2014


#29710: Add hooks to wpdb's insert(), update(), delete() and similar methods
-------------------------+------------------------------
 Reporter:  borekb       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Database     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  2nd-opinion  |     Focuses:
-------------------------+------------------------------

Comment (by borekb):

 Do you guys know how people commonly use the `query` filter, for what
 purpose? I tried some code search services and it seems that, first, it is
 used quite rarely, second, it is usually used to replace the WHERE part of
 the SELECT query.

 I'm wondering all that to find out if we would need access to the query
 ''before'' it was modified by the filter (i.e., as it was passed into the
 function) or not. If adding the `query` filter is rare and it only
 modifies the SELECT queries than we are probably fine with the modified
 query (the one stored as `$wpdb->last_query`). Otherwise, it would be
 useful for us to have access to the original query in some way as it
 captures the original intent of the caller of the `query()` method.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29710#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list