[wp-trac] [WordPress Trac] #54042: Extending wpdb::prepare() to support table/field names, and IN() operator

WordPress Trac noreply at wordpress.org
Sat May 7 01:05:59 UTC 2022

#54042: Extending wpdb::prepare() to support table/field names, and IN() operator
 Reporter:  craigfrancis                         |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Database                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-        |     Focuses:
  testing early has-unit-tests                   |

Comment (by apokalyptik):

 Replying to [comment:28 craigfrancis]:
 > Hi @apokalyptik, I'm not at my computer, but have you checked the
 [https://github.com/WordPress/wordpress-develop/pull/2191 patch] I've
 provided ([https://wpdb.eiv.dev/ test/download], note the last link
 includes support for `IN()`), it uses a slightly different syntax (`%...d`
 vs `%,d`) in a similar way to how [https://wiki.php.net/rfc/variadics
 variadics works in PHP], but I ''think'' it covers all the points you
 raised, and works with [https://core.trac.wordpress.org/ticket/52506
 table/field name] (identifiers) [https://github.com/WordPress/wordpress-
 develop/pull/2192 patch] that's had a few reviews already... if I've
 missed anything, please let me know.

 Hi! I have to admit. I did all this before even thinking about looking to
 see if there was already work being done on this. So *after* doing what I
 did I went and found this ticket, and so decided to post my experience and
 code. I never considered that it might be taken as a critique on existing
 work, so please please don't take it that way. I have not reviewed the
 code... anywhere :D (except my own, obviously)

Ticket URL: <https://core.trac.wordpress.org/ticket/54042#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list