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

WordPress Trac noreply at wordpress.org
Fri Nov 5 12:04:02 UTC 2021


#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                                  |
-------------------------------------------------+-------------------------

Comment (by johnbillion):

 Thanks for working on this @craigfrancis.

 I think this functionality needs to be introduced via a new `wpdb` method,
 otherwise there is no means for a plugin to safely determine whether it's
 able to use the new formats while retaining support for older versions of
 WordPress. It's not safe to check the WordPress version number because a
 custom `content/db.php` driver could be in use which doesn't support the
 new formats and would return invalid SQL. If a new method was introduced
 instead then the plugin could safely check for the existence of the method
 and use the new formats, and fall back to using `prepare()` without them
 if it doesn't exist.

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


More information about the wp-trac mailing list