[wp-trac] [WordPress Trac] #39997: Loads of child style.css using version of parent
WordPress Trac
noreply at wordpress.org
Wed Mar 1 21:21:56 UTC 2017
#39997: Loads of child style.css using version of parent
-------------------------------+------------------------------
Reporter: parsmizban | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version: 4.7.2
Severity: normal | Resolution: invalid
Keywords: reporter-feedback | Focuses: template
-------------------------------+------------------------------
Changes (by parsmizban):
* status: reopened => closed
* resolution: => invalid
Comment:
I reviewed the code of [https://wordpress.org/themes/twentyfifteen/
twentyfifteen theme] because my child theme is based on twentyfifteen
theme...
in file function.php I found this line:
{{{#!php
<?php
// Load our main stylesheet.
wp_enqueue_style( 'twentyfifteen-style', get_stylesheet_uri() );
}}}
So this will lead to load the style.css using default '''WordPress
version''' and NOT the theme itself!
I think this part should be fix in the theme twentyfifteen too (May be in
other default theme too) ...
First I changed the line to this:
{{{#!php
<?php
wp_enqueue_style( 'twentyfifteen-style', get_stylesheet_uri(), array( ),
wp_get_theme()->get( 'Version' ) );
}}}
Using {{{ wp_get_theme()->get( 'Version' ) }}} both child theme and parent
theme get correct version when they load
I checked other default WordPress themes (2014,2015,2016,2017) , They all
missed the version of theme
So I think this is needed for them because of future update of style.css
It is prefer to the default WordPress version, It should load the version
of theme and not WordPress version
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39997#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list