Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#56625 closed defect (bug) (fixed)

Bad link in doc caused by docblock typo

Reported by: camwynsp's profile Camwynsp Owned by: davidbaumwald's profile davidbaumwald
Milestone: 6.1 Priority: normal
Severity: normal Version: 4.6
Component: General Keywords: needs-patch good-first-bug commit
Focuses: docs Cc:

Attachments (1)

#56635.patch (588 bytes) - added by hilayt24 2 years ago.
The hook is now outside the brackets.

Download all attachments as: .zip

Change History (8)

#1 @Camwynsp
2 years ago

  • Summary changed from Bad link in doc to Bad link in doc caused by docblock typo

#2 @kebbet
2 years ago

This seems to be an issue on the developer.wordpress.org side of things, since all links for deprecated functions no longer links correct pages. The ´ characters are used to format the links on developer.wordpress.org.

See e.g. https://developer.wordpress.org/reference/hooks/edit_category_form_pre/

Last edited 2 years ago by kebbet (previous) (diff)

#3 @davidbaumwald
2 years ago

  • Focuses docs added
  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 6.1
  • Version set to 4.6

@Camwynsp Thanks for the ticket and welcome to WordPress core Trac!!

This indeed does need to be fixed. This seems to trace back to r37543. Let's resolve this in 6.1.

#4 @SergeyBiryukov
2 years ago

Hi there, thanks for the ticket!

Just to clarify a bit for others looking at the ticket (I misread it initially), the {@see 'hook_name'} format itself is fine and is used in many other places in core.

There appear to be two disctinct issues here:

  1. The hook in question has a hook word inside the quotes:
    There is a {@see 'hook deprecated_function_run'}
    
    That should be fixed, as noted in comment:3:
    There is a hook {@see 'deprecated_function_run'}
    
  2. Something weird is going on with hook links in general on the developer.wordpress.org side too, as noted in comment:1. That is unrelated to this particular hook and needs more investigation.

#5 @hilayt24
2 years ago

Hi @Camwynsp, Thanks for the ticket. @SergeyBiryukov I added the patch for the 1st issue.

@hilayt24
2 years ago

The hook is now outside the brackets.

#6 @davidbaumwald
2 years ago

  • Keywords commit added
  • Owner set to davidbaumwald
  • Status changed from new to reviewing

#7 @davidbaumwald
2 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 54292:

Docs: Correct @see reference to deprecated_function_run in the _deprecated_function docblock.

In the docblock for _deprecated_function, there is a @see reference to the deprecated_function_run hook run inside _deprecated_function. However, the @see reference includes the word "hook" inside the quotes which is generating a bad link at https://developer.wordpress.org/reference/functions/_deprecated_function/.

This change simply moves the word "hook" outside the @see reference to correct the link parsing on https://developer.wordpress.org.

Props Camwynsp, kebbet, SergeyBiryukov, hilayt24.
Fixes #56625.

Note: See TracTickets for help on using tickets.