[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:54:21 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 | Resolution:
Keywords: good-first-bug | Focuses: docs
----------------------------+------------------------------
Old description:
> 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 ) {
> ...
>
> }}}
New description:
As reported by @timhavinga, the `esc_like()` reference in the 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 ) {
...
}}}
--
Comment (by DrewAPicture):
Note: I've temporarily fixed the link manually pending a fix against the
5.1 milestone once trunk development reopens.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45204#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list