From 1954fa738509a4a83ae0f04ca83509149580c5cb Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 16 Apr 2019 14:55:48 +0000 Subject: [PATCH] Bundled Themes: Use the theme version when enqueuing theme specific stylesheets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For many bundled theme related stylesheets, a version is either not specified, or specified as a hardcoded date string when enqueued. This is problematic when a stylesheet is updated and the version number is not (which has happened several times recently). This change ensures that all bundled theme related stylesheets use the theme’s version as the stylesheet version. This ensures cache busting for theme stylesheets every time a theme is updated and guarantees that users receive any new or updated styles included in the update when visiting the site for the first time after an update. Props parsmizban, ianbelanger, dswebsme. Fixes #39997. git-svn-id: https://develop.svn.wordpress.org/trunk@45213 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentyeleven/functions.php | 4 ++-- src/wp-content/themes/twentyeleven/header.php | 2 +- .../themes/twentyeleven/inc/theme-options.php | 4 ++-- src/wp-content/themes/twentyfifteen/functions.php | 10 +++++----- src/wp-content/themes/twentyfourteen/functions.php | 8 ++++---- src/wp-content/themes/twentyseventeen/functions.php | 12 ++++++------ src/wp-content/themes/twentysixteen/functions.php | 12 ++++++------ src/wp-content/themes/twentyten/functions.php | 4 ++-- src/wp-content/themes/twentyten/header.php | 2 +- src/wp-content/themes/twentythirteen/functions.php | 6 +++--- src/wp-content/themes/twentytwelve/functions.php | 8 ++++---- 11 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/wp-content/themes/twentyeleven/functions.php b/src/wp-content/themes/twentyeleven/functions.php index b3b1466ef4..675e1badca 100644 --- a/src/wp-content/themes/twentyeleven/functions.php +++ b/src/wp-content/themes/twentyeleven/functions.php @@ -294,7 +294,7 @@ endif; // twentyeleven_setup */ function twentyeleven_scripts_styles() { // Theme block stylesheet. - wp_enqueue_style( 'twentyeleven-block-style', get_template_directory_uri() . '/blocks.css', array(), '20181230' ); + wp_enqueue_style( 'twentyeleven-block-style', get_template_directory_uri() . '/blocks.css', array(), wp_get_theme()->get( 'Version' ) ); } add_action( 'wp_enqueue_scripts', 'twentyeleven_scripts_styles' ); @@ -305,7 +305,7 @@ add_action( 'wp_enqueue_scripts', 'twentyeleven_scripts_styles' ); */ function twentyeleven_block_editor_styles() { // Block styles. - wp_enqueue_style( 'twentyeleven-block-editor-style', get_template_directory_uri() . '/editor-blocks.css', array(), '20181230' ); + wp_enqueue_style( 'twentyeleven-block-editor-style', get_template_directory_uri() . '/editor-blocks.css', array(), wp_get_theme()->get( 'Version' ) ); } add_action( 'enqueue_block_editor_assets', 'twentyeleven_block_editor_styles' ); diff --git a/src/wp-content/themes/twentyeleven/header.php b/src/wp-content/themes/twentyeleven/header.php index 39cbe89c11..56143a9e98 100644 --- a/src/wp-content/themes/twentyeleven/header.php +++ b/src/wp-content/themes/twentyeleven/header.php @@ -48,7 +48,7 @@ if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { ?> - +