WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 6 weeks ago

#44585 reopened defect (bug)

Docs: $wpdb->prepare should point to $wpdb->esc_like method

Reported by: felipeelia Owned by:
Milestone: Future Release 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)

44585.diff (771 bytes) - added by mbelchev 6 weeks ago.
44585.2.diff (764 bytes) - added by mbelchev 6 weeks ago.

Download all attachments as: .zip

Change History (7)

#1 @mbelchev
8 weeks ago

  • Keywords 2nd-opinion added; needs-patch removed
  • Resolution set to worksforme
  • Status changed from new to closed

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.

#2 @ocean90
6 weeks 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().

@mbelchev
6 weeks ago

#3 @mbelchev
6 weeks 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 @ocean90
6 weeks 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.

@mbelchev
6 weeks ago

#5 @mbelchev
6 weeks ago

  • Keywords needs-testing added; needs-refresh removed
Note: See TracTickets for help on using tickets.