Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#42788 closed defect (bug) (wontfix)

In get_search_template, replace apostrophes with backticks in inline docs so Doc parser parses as code

Reported by: webdevmattcrom's profile webdevmattcrom Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: General Keywords: has-patch
Focuses: docs Cc:

Description

In get_search_template, replace apostrophes with backticks in inline docs so Doc parser parses as code.

See here: https://core.trac.wordpress.org/browser/tags/4.9/src/wp-includes/template.php#L437

Change this:

The template hierarchy and template path are filterable via the 
{@see '$type_template_hierarchy'} and {@see '$type_template'} 
dynamic hooks, where `$type` is 'search'.

To this:

The template hierarchy and template path are filterable via the 
{@see `$type_template_hierarchy`} and {@see `$type_template`} 
dynamic hooks, where `$type` is `search`.

Patch coming soon.

Attachments (1)

ticket#42788.patch (633 bytes) - added by webdevmattcrom 7 years ago.
Patch for ticket#42788 -- replaces apostrophes with backticks.

Download all attachments as: .zip

Change History (4)

@webdevmattcrom
7 years ago

Patch for ticket#42788 -- replaces apostrophes with backticks.

#1 @DrewAPicture
7 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 5.0

@webdevmattcrom thanks for the patch. I'll fix this one in commit, but if you could please generate patches from the WordPress root in the future, that would be very helpful for other contributors applying and testing patches.

#2 @DrewAPicture
7 years ago

  • Milestone 5.0 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Actually, in this particular case, we can't replace the single quotes in inline @see tags with backticks because the parser is expecting the hook name to be in single quote. So actually closing this one as wontfix, sorry.

Background: Since hooks are a WordPress-specific feature not supported by phpDocumentor out of the box, our docs parser specifically looks for {@see 'something'} and knows to convert that to an inline link to the corresponding hook reference page.

If there's somewhere where you aren't seeing hooks getting auto-linked on DevHub, that would be a separate problem that needs to be addressed.

#3 @webdevmattcrom
7 years ago

Thanks for the clarification, I'll review the PHP parser spec in more detail before submitting next time.

Note: See TracTickets for help on using tickets.