[wp-trac] [WordPress Trac] #45204: Fix a broken link for esc_like() in the wpdb->prepare() DocBlock

WordPress Trac noreply at wordpress.org
Fri Oct 26 17:49:44 UTC 2018


#45204: Fix a broken link for esc_like() in the wpdb->prepare() DocBlock
--------------------------+-----------------------------
 Reporter:  DrewAPicture  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Database      |    Version:
 Severity:  normal        |   Keywords:  good-first-bug
  Focuses:  docs          |
--------------------------+-----------------------------
 As reported by @timhavinga, the `esc_like()` reference in the
 [https://developer.wordpress.org/reference/classes/wpdb/prepare/#description
 fourth paragraph] of the DocBlock description for `wpdb->prepare()` is
 invalid. It should point to to the `wpdb->esc_like()` ''method'', vs a
 (nonexistent) standalone function.

 The DocBlock description for a function, class, method, or hook
 corresponds to the Description section of the reference article for that
 element when it's parsed from source. So to reference a class method in a
 DocBlock with an inline `@see` tag, the format is `{@see
 Class_Name::method_name()}`

 Current docs:
 {{{#!php
 <?php
  * ...
  *
  * Literal percentage signs (%) in the query string must be written as %%.
 Percentage wildcards (for example,
  * to use in LIKE syntax) must be passed via a substitution argument
 containing the complete LIKE string, these
  * cannot be inserted directly in the query string. Also see {@see
 esc_like()}.
  *
  * ...
  */
 public function prepare( $query, $args ) {
 ...

 }}}

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


More information about the wp-trac mailing list