#2879 closed defect (bug) (fixed)
Regex for @see linking of hooks does not account for unencoded quotes
Reported by: | coffee2code | Owned by: | coffee2code |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Developer Hub | Keywords: | |
Cc: |
Description
When using the @see
notation to link to hooks, it is necessary to place single quotes around the hook name. In the context of function descriptions (the majority usage), those quotes are already encoded as HTML entities prior to handling by link_internal_element()
. However, data stored in meta (such as hash param descriptions) are not encoded. Thus, regular single quotes must also be considered in the auto-link handling for hooks (which presumes quotes are encoded).
For example, comment_form()
https://developer.wordpress.org/reference/functions/comment_form/:
It's $args
argument is a hash parameter. The first element 'fields' references a hook properly as {@see 'comment_form_default_fields'}
and that string is eventually passed unencoded to link_internal_element()
where, due to the lack of quote encoding, it passes through to the fallback option of assuming it should link to a function.
In 5577: