Opened 11 years ago
Closed 11 years ago
#25658 closed enhancement (fixed)
Handle duplicate hooks in inline documentation
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Inline Docs | Keywords: | has-patch |
Focuses: | Cc: |
Description
It looks like inline documentation efforts for hooks will continue well into 3.8, so rather than being able to rely on all hooks being documented and developer.wordpress.org being up and running, we should replace //duplicate_hook
with something that is more human-parseable for release.
My suggestion: /** This hook is documented in {file} */
. Alternatively, replace 'hook' with 'action' or 'filter', respectively.
Perhaps in the future, it would be a link to the hook's documentation on developer.wordpress.org instead (or in addition to).
There's only 40 duplicate hooks, and it's pretty easy to generate a list of them with something like ack -A 1 duplicate_hook
, which will return the line that follows the match. From there, we could look for each hook and look at the line before it, until we return */
, rather than the duplicate_hook comment. Then we would know where it is located. Or they could use a global project search in their editor. I imagine it would take someone about 20-30 minutes to do the whole thing?
Attachments (3)
Change History (10)
#1
@
11 years ago
- Keywords has-patch added
25658.diff changes //duplicate_hook
references to their _action
, and _filter
counterparts. I agree that we should probably have a way to link them up with the original hooks, but that it may be better to wait on a longer-term solution until 3.8.
#2
@
11 years ago
25658.diff changes duplicate_hook references to their _action, and _filter counterparts.
I meant that the string should become This action is documented in {file}
or This filter is documented in {file}
. Otherwise we should probably just remove them from the branch and leave them in trunk.
#6
@
11 years ago
You know how I like to be literal, so I've attached two patches:
- 25658-braces.diff where files are specified
{wp-admin/whatever.php}
- 25658-no-braces.diff where files are specificed
wp-admin/whatever.php
Didn't know if you needed the curly braces to more easily target the filename.
_action/_filter