[wp-trac] [WordPress Trac] #41925: Bring back, support and document %1$s support in wpdb->prepare

WordPress Trac noreply at wordpress.org
Wed Sep 20 10:11:22 UTC 2017


#41925: Bring back, support and document %1$s support in wpdb->prepare
-------------------------+------------------------------
 Reporter:  soulseekah   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Database     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------
Changes (by ocean90):

 * version:  trunk =>
 * type:  feature request => enhancement


Comment:

 Noting that this format was never really supported as stated in the
 DocBlock:

 > The following directives can be used in the query format string:
 >  %d (integer)
 >  %f (float)
 >  %s (string)
 >  %% (literal percentage sign - no argument needed)
 >
 > All of %d, %f, and %s are to be left unquoted in the query string and
 they need an argument passed for them.
 > Literals (%) as parts of the query must be properly written as %%.
 >
 > This function only supports a small subset of the sprintf syntax; it
 only supports %d (integer), %f (float), and %s (string).
 > Does not support sign, padding, alignment, width or precision
 specifiers.
 > Does not support argument numbering/swapping.

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


More information about the wp-trac mailing list