Make WordPress Core


Ignore:
Timestamp:
07/09/2008 05:24:36 PM (16 years ago)
Author:
ryan
Message:

Introduce content_url(). Don't prepend base url to content url in script loader. see #6938 #7001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r8197 r8301  
    801801
    802802function admin_url($path = '') {
    803     global $_wp_admin_url;
    804 
    805803    $url = site_url('wp-admin/', 'admin');
    806804
     
    812810
    813811function includes_url($path = '') {
    814     global $_wp_includes_url;
    815 
    816812    $url = site_url() . '/' . WPINC . '/';
    817813
     
    822818}
    823819
     820function content_url($path = '') {
     821    $scheme = ( is_ssl() ? 'https' : 'http' );
     822    $url = WP_CONTENT_URL;
     823    if ( 0 === strpos($url, 'http') ) {
     824        if ( is_ssl() )
     825            $url = str_replace( 'http://', "{$scheme}://", $url );
     826    }
     827
     828    if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
     829        $url .= '/' . ltrim($path, '/');
     830
     831    return $url;
     832}
     833
    824834?>
Note: See TracChangeset for help on using the changeset viewer.