Opened 6 years ago
Closed 6 years ago
#44585 closed defect (bug) (fixed)
Docs: $wpdb->prepare should point to $wpdb->esc_like method
Reported by: | felipeelia | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Database | Keywords: | good-first-bug has-patch needs-testing |
Focuses: | docs | Cc: |
Description
There is a broken link into $wpdb->prepare()
docs: it points to https://developer.wordpress.org/reference/functions/esc_like where it should point to https://developer.wordpress.org/reference/classes/wpdb/esc_like/.
I'm not sure, but I guess it's generated from inline docs, and should be solved simply changing {@see esc_like()}
to {@see wpdb::esc_like()}
in this line.
Attachments (2)
Change History (10)
#1
@
6 years ago
- Keywords 2nd-opinion added; needs-patch removed
- Resolution set to worksforme
- Status changed from new to closed
#2
@
6 years ago
- Focuses docs added
- Keywords needs-patch good-first-bug added; 2nd-opinion removed
- Milestone changed from Awaiting Review to Future Release
- Resolution worksforme deleted
- Status changed from closed to reopened
The @see tag should only be used for filters. To fix the linking {@see esc_like()}
should get replaced with wpdb::esc_like()
.
#3
@
6 years ago
- Keywords has-patch needs-testing added; needs-patch removed
Thank you for the clarification, @ocean90! Appreciate your help and I just applied a patch for this change.
#4
@
6 years ago
- Keywords needs-refresh added; needs-testing removed
@mbelchev Thanks for the patch! Can you remove the @see
part too? It really only needs to be wpdb::esc_like()
, the autolinking is handled automatically on developer.w.org.
#6
@
6 years ago
It seems that while you guys were working on this ticket, a duplicate ticket was created. In that ticket (#45204), a patch was accepted and implemented in WordPress's code base. That patch happened to be identical to the first patch in the current ticket (#44585), namely 44585.diff
.
However, @ocean90 has pointed out that this patch is inadequate. As a result, @mbelchev proposed a second patch (44585.2.diff
), which is the one that we want.
Because the inadequate patch has already been implemented in the WordPress code base in the mean time, the 44585.2.diff
patch no longer applies. Therefore, a new patch should be created to implement @ocean90's solution as applied to the current version of the code base.
Hey @felipeelia, if you're talking about the link to wpdb::esc_like on this page - https://developer.wordpress.org/reference/classes/wpdb/prepare/ (http://prntscr.com/lmor6f), it works for me.
It redirects me to the correct link which you've mentioned in the ticket description. But seems like the inline docs isn't changed.
Probably, we need another confirmation or correct me if I'm talking for something else.