[wp-trac] [WordPress Trac] #62079: Twenty Fifteen : PHPCS Fixes
WordPress Trac
noreply at wordpress.org
Thu Sep 19 20:18:16 UTC 2024
#62079: Twenty Fifteen : PHPCS Fixes
-----------------------------------+-------------------------------------
Reporter: pitamdey | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version:
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion | Focuses: docs, coding-standards
-----------------------------------+-------------------------------------
Changes (by sabernhardt):
* keywords: has-patch => has-patch 2nd-opinion
* focuses: => docs, coding-standards
Comment:
The patch proposes many changes:
- adds a `param` note in the `twentyfifteen_excerpt_more()` docblock
- escapes 21 translations
- escapes `number_format_i18n()` in the comments template
- escapes `$GLOBALS['wp_version']` in `back-compat.php` functions
- escapes multiple items in `twentyfifteen_entry_meta()`
1. `get_post_format_string()`, which returns a translation
2. `$categories_list` and `$tags_list`
([https://core.trac.wordpress.org/browser/trunk/src/wp-
content/themes/twentytwentyone/inc/template-
tags.php?rev=57991&marks=150,159#L141 TT1 does not escape taxonomy lists])
3. width and height for the full size attachment link
([https://core.trac.wordpress.org/browser/trunk/src/wp-
content/themes/twentytwentyone/image.php?rev=55276&marks=86-87#L78 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
[https://core.trac.wordpress.org/browser/trunk/src/wp-
content/themes/twentyfourteen/inc/template-
tags.php?rev=55276&marks=232#L226 description in Twenty Fourteen] and
Twenty Thirteen:
{{{
* @param string $more Default Read More excerpt link.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62079#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list