[wp-trac] [WordPress Trac] #39997: Loads of child style.css using version of parent
WordPress Trac
noreply at wordpress.org
Wed Mar 1 11:35:24 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 subrataemfluence):
* status: reopened => closed
* resolution: => invalid
Comment:
First,
[https://developer.wordpress.org/reference/functions/wp_enqueue_style/
wp_enqueue_style] is not a plugin. It is a WordPress core function used to
introduce CSS style sheets to a theme with the ability to pass several
values by help of function parameters in order make sure it renders
exactly the way we want!
This function is usually written in theme's `functions.php` file. If no
version is specified WordPress will auto assign parent theme's version.
{{{
/* Syntax: wp_enqueue_style( string $handle, string $src = '', array $deps
= array(), string|bool|null $ver = false, string $media = 'all' ) */
wp_enqueue_style('style', get_stylesheet_uri(), array(), '1.0', 'all');
}}}
I could not reproduce the issue when I created a child theme and assign a
version number (in my case it is `1.0`) to `style.css` like above. It
renders like
`<link rel='stylesheet' id='style-css' href='http://local.xyz.com/wp-
content/themes/customizr-child/style.css?ver=1.0' type='text/css'
media='all' />`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39997#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list