Make WordPress Core


Ignore:
Timestamp:
12/28/2009 12:48:20 AM (15 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-styles.php

    r11383 r12558  
    3636            return false;
    3737
    38         $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
     38        if ( null === $this->registered[$handle]->ver )
     39            $ver = '';
     40        else
     41            $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
     42
    3943        if ( isset($this->args[$handle]) )
    40             $ver .= '&' . $this->args[$handle];
     44            $ver = $ver ? $ver . '&' . $this->args[$handle] : '?' . $this->args[$handle];
    4145
    4246        if ( $this->do_concat ) {
     
    101105        }
    102106
    103         $src = add_query_arg('ver', $ver, $src);
     107        if ( !empty($ver) )
     108            $src = add_query_arg('ver', $ver, $src);
    104109        $src = apply_filters( 'style_loader_src', $src, $handle );
    105110        return esc_url( $src );
Note: See TracChangeset for help on using the changeset viewer.