WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/28/2009 12:48:20 AM (12 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class.wp-scripts.php

    r11383 r12558  
    9191            $this->in_footer = array_diff( $this->in_footer, (array) $handle );
    9292
    93         $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
     93        if ( null === $this->registered[$handle]->ver )
     94            $ver = '';
     95        else
     96            $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
     97
    9498        if ( isset($this->args[$handle]) )
    95             $ver .= '&' . $this->args[$handle];
     99            $ver = $ver ? $ver . '&' . $this->args[$handle] : '?' . $this->args[$handle];
    96100
    97101        $src = $this->registered[$handle]->src;
     
    115119        }
    116120
    117         $src = add_query_arg('ver', $ver, $src);
     121        if ( !empty($ver) )
     122            $src = add_query_arg('ver', $ver, $src);
    118123        $src = esc_url(apply_filters( 'script_loader_src', $src, $handle ));
    119124
Note: See TracChangeset for help on using the changeset viewer.