Opened 4 years ago
Last modified 4 years ago
#56663 new enhancement
`tag_escape()` does not follow naming convention.
| Reported by: | peterwilsoncc | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Formatting | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | coding-standards |
Description
In WordPress, escaping functions generally use the naming convention esc_thing().
The tag_escape() function and it's associated hook do not. Is it worth renaming each to either esc_tag or the more precise esc_html_tag?
There is some use within the plugin repository but not a huge amount.
Change History (2)
#2
@
4 years ago
It looks like tag_escape() was introduced to match attribute_escape(), but then got missed when attribute_escape() was replaced with esc_attr():
- [4656] introduced
attribute_escape(). - [7497] introduced
tag_escape(). - [11103] turned
attribute_escape()into a wrapper forattr(). - [11204] renamed
attr()toesc_attr(). - [13096] deprecated
attribute_escape()in favor ofesc_attr().
I think esc_tag() would be more in line with esc_attr().
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I'm for the
esc_html_tagoption. Would be more precise and in line with the other escaping functions 👍🏼