WP_Dependencies: pass NULL to disable script and style version query strings, props scribu amattie, fixes #11315

git-svn-id: http://svn.automattic.com/wordpress/trunk@12558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz
2009-12-28 00:48:20 +00:00
parent 16e175cc0f
commit 7b40c7a03f
5 changed files with 29 additions and 15 deletions

View File

@@ -90,9 +90,13 @@ class WP_Scripts extends WP_Dependencies {
if ( false === $group && in_array($handle, $this->in_footer, true) )
$this->in_footer = array_diff( $this->in_footer, (array) $handle );
$ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
if ( null === $this->registered[$handle]->ver )
$ver = '';
else
$ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
if ( isset($this->args[$handle]) )
$ver .= '&' . $this->args[$handle];
$ver = $ver ? $ver . '&' . $this->args[$handle] : '?' . $this->args[$handle];
$src = $this->registered[$handle]->src;
@@ -114,7 +118,8 @@ class WP_Scripts extends WP_Dependencies {
$src = $this->base_url . $src;
}
$src = add_query_arg('ver', $ver, $src);
if ( !empty($ver) )
$src = add_query_arg('ver', $ver, $src);
$src = esc_url(apply_filters( 'script_loader_src', $src, $handle ));
if ( $this->do_concat )