Opened 3 weeks ago
Last modified 12 days ago
#62079 new defect (bug)
Twenty Fifteen : PHPCS Fixes
Reported by: | pitamdey | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch 2nd-opinion |
Focuses: | docs, coding-standards | Cc: |
Description
In theme Twenty-Fifteen, I can see there are a few PHPCS errors, so I have applied an patch to fix it.
Attachments (2)
Change History (6)
#1
@
3 weeks ago
- Focuses docs coding-standards added
- Keywords 2nd-opinion added
The patch proposes many changes:
- adds a
param
note in thetwentyfifteen_excerpt_more()
docblock - escapes 21 translations
- escapes
number_format_i18n()
in the comments template - escapes
$GLOBALS['wp_version']
inback-compat.php
functions - escapes multiple items in
twentyfifteen_entry_meta()
get_post_format_string()
, which returns a translation$categories_list
and$tags_list
(TT1 does not escape taxonomy lists)- width and height for the full size attachment link (TT1 uses absint() in its image template)
I do not recommend all the escaping for (only) this theme.
Core translations are trusted (ticket:58127#comment:1), and #30724 specifically removed escaping functions for Twenty Fifteen's translations. If that policy ever changes for bundled themes before Twenty Twenty-One, that effort could have one ticket for all the themes.
For future reference, note that _e()
would need to be replaced with esc_html_e()
, not esc_html__()
(404.php
template).
The twentyfifteen_excerpt_more()
function should document the $more
parameter, and I like the similar description in Twenty Fourteen and Twenty Thirteen:
* @param string $more Default Read More excerpt link.
#2
@
2 weeks ago
- Keywords commit added
- Milestone changed from Awaiting Review to 6.7
Hi there, thanks for the ticket!
It appears that while the other changes could use some more discussion, 62079.docs.patch is ready for commit.
Patch for this issue