[wp-trac] [WordPress Trac] #46979: Bundled themes should pass version to wp_enqueue_style() to ensure proper cache busting

WordPress Trac noreply at wordpress.org
Thu Apr 18 18:56:13 UTC 2019


#46979: Bundled themes should pass version to wp_enqueue_style() to ensure proper
cache busting
--------------------------+-----------------------
 Reporter:  dswebsme      |       Owner:  dswebsme
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  5.2.1
Component:  Themes        |     Version:  5.1.1
 Severity:  minor         |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------
Description changed by dswebsme:

Old description:

> Bundled themes should pass the current theme version (`$ver` parameter)
> to `wp_enqueue_style()` to ensure theme stylesheets properly bypass cache
> after being updated.
>
> Dev discussion on the subject took place here: #39997
>
> This affects themes `twentyten` - `twentyseventeen`. Bundled theme
> `twentynineteen` already passes a dynamic `$ver` parameter.
>
> Key details provided by @desrosj
>
> I audited the stylesheet last edit dates and the version specified in the
> `wp_enqueue_style()` call. Let's leave Twenty Nineteen alone (that was
> already calling `wp_get_theme()->get( 'Version' )`, and make sure the
> dates are correct (and actually present) for each stylesheet. Results
> (dates in YYYY-MM-DD):
>
> || ||= **Last Modified** =||= **Current Specified Version** =||
> ||= **Twenty Ten** =|| || ||
> ||= `blocks.css` =||  `2018-12-18`  || `20181018`* ||
> ||= `editor-blocks.css` =||  `2018-12-18`  || none ||
> ||= `style.css` =||  `2019-02-07`  || none ||
> ||= **Twenty Eleven** =|| || ||
> ||= `blocks.css` =||  `2019-01-02`  || `20181230`* ||
> ||= `editor-blocks.css` =||  `2019-01-02`  || `20181230`* ||
> ||= `style.css` =||  `2019-04-04`  || none ||
> ||= `/inc/theme-options.css` =||  `2011-06-02`  || `2011-04-28`* ||
> ||= `/colors/dark.css` =||  `2019-04-04`  || `null`** ||
> ||= **Twenty Twelve** =|| || ||
> ||= `style.css` =||  `2019-04-06`  || none ||
> ||= `/css/blocks.css` =||  `2019-04-06`  || `20181230`* ||
> ||= `/css/ie.css` =||  `2015-02-14`  || `20121010`* ||
> ||= `/css/editor-blocks.css` =||  `2019-04-06`  || `20181230`* ||
> ||= **Twenty Thirteen** =|| || ||
> ||= `style.css` =||  `2019-02-07`  || `2013-07-18`* ||
> ||= `/css/blocks.css` =||  `2019-01-02`  || `2018-12-30`* ||
> ||= `/css/ie.css` =||  `2015-02-14`  || `2013-07-18`* ||
> ||= `/css/editor-blocks.css` =||  `2019-01-02`  || `2018-12-30`* ||
> ||= **Twenty Fourteen** =|| || ||
> ||= `style.css` =||  `2019-02-07`  || none ||
> ||= `/css/blocks.css` =||  `2019-01-02`  || `20181230`* ||
> ||= `/css/ie/css` =||  `2014-07-01`  || `20131205`* ||
> ||= `/css/editor-blocks.css` =||  `2019-01-02`  || `20181230`* ||
> ||= **Twenty Fifteen** =|| || ||
> ||= `style.css` =||  `2019-04-02`  || none ||
> ||= `/css/blocks.css` =||  `2019-01-02`  || `20181230`* ||
> ||= `/css/ie.css` =||  `2017-09-16`  || `20141010`* ||
> ||= `/css/ie7.css` =||  `2014-12-10`  || `20141010`* ||
> ||= `css/edtior-blocks.css` =||  `2019-01-02`  || `20181230`* ||
> ||= **Twenty Sixteen** =|| || ||
> ||= `style.css` =||  `2019-02-07`  || none ||
> ||= `/css/blocks.css` =||  `2019-01-02`  || `20181230`* ||
> ||= `/css/ie8.css` =||  `2017-05-30`  || `20160816`* ||
> ||= `/css/ie7.css` =||  `2017-05-30`  || `20160816`* ||
> ||= `/css/editor-blocks.css` =||  `2019-01-02`  || `20181230`* ||
> ||= **Twenty Seventeen** =|| || ||
> ||= `style.css` =||  `2019-04-08`  || none ||
> ||= `/assets/css/blocks.css` =||  `2019-01-05`  || `1.1` ||
> ||= `/assets/css/colors-dark.css` =||  `2019-04-08`  || `1.0` ||
> ||= `/assets/css/ie9.css` =||  `2016-12-02`  || `1.0` ||
> ||= `/assets/css/ie8.css` =||  `2016-12-02`  || `1.0` ||
> ||= `/assets/css/editor-blocks.css` =||  `2019-03-28`  || `1.1` ||

New description:

 Bundled themes should pass the current theme version (`$ver` parameter) to
 `wp_enqueue_style()` to ensure theme stylesheets properly bypass cache
 after being updated.

 Dev discussion on the subject took place here: #39997

 This affects themes `twentyten` - `twentyseventeen`. Bundled theme
 `twentynineteen` already passes a dynamic `$ver` parameter.

 Key details provided by @desrosj

 I audited the stylesheet last edit dates and the version specified in the
 `wp_enqueue_style()` call. Let's leave Twenty Nineteen alone (that was
 already calling `wp_get_theme()->get( 'Version' )`, and make sure the
 dates are correct (and actually present) for each stylesheet. Results
 (dates in YYYY-MM-DD):

 || ||= **Last Modified** =||= **Current Specified Version** =||
 ||= **Twenty Ten** =|| || ||
 ||= `blocks.css` =||  `2018-12-18`  || `20181018`* ||
 ||= `editor-blocks.css` =||  `2018-12-18`  || none ||
 ||= `style.css` =||  `2019-02-07`  || none ||
 ||= **Twenty Eleven** =|| || ||
 ||= `blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `editor-blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `style.css` =||  `2019-04-04`  || none ||
 ||= `/inc/theme-options.css` =||  `2011-06-02`  || `2011-04-28`* ||
 ||= `/colors/dark.css` =||  `2019-04-04`  || `null`** ||
 ||= **Twenty Twelve** =|| || ||
 ||= `style.css` =||  `2019-04-06`  || none ||
 ||= `/css/blocks.css` =||  `2019-04-06`  || `20181230`* ||
 ||= `/css/ie.css` =||  `2015-02-14`  || `20121010`* ||
 ||= `/css/editor-blocks.css` =||  `2019-04-06`  || `20181230`* ||
 ||= **Twenty Thirteen** =|| || ||
 ||= `style.css` =||  `2019-02-07`  || `2013-07-18`* ||
 ||= `/css/blocks.css` =||  `2019-01-02`  || `2018-12-30`* ||
 ||= `/css/ie.css` =||  `2015-02-14`  || `2013-07-18`* ||
 ||= `/css/editor-blocks.css` =||  `2019-01-02`  || `2018-12-30`* ||
 ||= **Twenty Fourteen** =|| || ||
 ||= `style.css` =||  `2019-02-07`  || none ||
 ||= `/css/blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `/css/ie/css` =||  `2014-07-01`  || `20131205`* ||
 ||= `/css/editor-blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= **Twenty Fifteen** =|| || ||
 ||= `style.css` =||  `2019-04-02`  || none ||
 ||= `/css/blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `/css/ie.css` =||  `2017-09-16`  || `20141010`* ||
 ||= `/css/ie7.css` =||  `2014-12-10`  || `20141010`* ||
 ||= `css/edtior-blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= **Twenty Sixteen** =|| || ||
 ||= `style.css` =||  `2019-02-07`  || none ||
 ||= `/css/blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `/css/ie8.css` =||  `2017-05-30`  || `20160816`* ||
 ||= `/css/ie7.css` =||  `2017-05-30`  || `20160816`* ||
 ||= `/css/editor-blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= **Twenty Seventeen** =|| || ||
 ||= `style.css` =||  `2019-04-08`  || none ||
 ||= `/assets/css/blocks.css` =||  `2019-01-05`  || `1.1` ||
 ||= `/assets/css/colors-dark.css` =||  `2019-04-08`  || `1.0` ||
 ||= `/assets/css/ie9.css` =||  `2016-12-02`  || `1.0` ||
 ||= `/assets/css/ie8.css` =||  `2016-12-02`  || `1.0` ||
 ||= `/assets/css/editor-blocks.css` =||  `2019-03-28`  || `1.1` ||

 Added during DEV

 ||= **Twenty Sixteen** =|| || ||
 ||= `/css/ie.css` =||  `2017-05-30`  || `20160816`* ||

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46979#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list