git-svn-id: http://svn.automattic.com/wordpress/trunk@8301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
100ed8a62d
commit
e2aa6d619c
|
@ -50,7 +50,7 @@ class WP_Scripts extends WP_Dependencies {
|
|||
$ver .= '&' . $this->args[$handle];
|
||||
|
||||
$src = $this->registered[$handle]->src;
|
||||
if ( !preg_match('|^https?://|', $src) ) {
|
||||
if ( !preg_match('|^https?://|', $src) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $src) ) {
|
||||
$src = $this->base_url . $src;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ class WP_Styles extends WP_Dependencies {
|
|||
}
|
||||
|
||||
function _css_href( $src, $ver, $handle ) {
|
||||
if ( !preg_match('|^https?://|', $src) ) {
|
||||
if ( !preg_match('|^https?://|', $src) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $src) ) {
|
||||
$src = $this->base_url . $src;
|
||||
}
|
||||
|
||||
|
|
|
@ -800,8 +800,6 @@ function site_url($path = '', $scheme = null) {
|
|||
}
|
||||
|
||||
function admin_url($path = '') {
|
||||
global $_wp_admin_url;
|
||||
|
||||
$url = site_url('wp-admin/', 'admin');
|
||||
|
||||
if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
|
||||
|
@ -811,8 +809,6 @@ function admin_url($path = '') {
|
|||
}
|
||||
|
||||
function includes_url($path = '') {
|
||||
global $_wp_includes_url;
|
||||
|
||||
$url = site_url() . '/' . WPINC . '/';
|
||||
|
||||
if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
|
||||
|
@ -821,4 +817,18 @@ function includes_url($path = '') {
|
|||
return $url;
|
||||
}
|
||||
|
||||
function content_url($path = '') {
|
||||
$scheme = ( is_ssl() ? 'https' : 'http' );
|
||||
$url = WP_CONTENT_URL;
|
||||
if ( 0 === strpos($url, 'http') ) {
|
||||
if ( is_ssl() )
|
||||
$url = str_replace( 'http://', "{$scheme}://", $url );
|
||||
}
|
||||
|
||||
if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
|
||||
$url .= '/' . ltrim($path, '/');
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -337,7 +337,7 @@ function get_theme_root() {
|
|||
}
|
||||
|
||||
function get_theme_root_uri() {
|
||||
return apply_filters('theme_root_uri', WP_CONTENT_URL . "/themes", get_option('siteurl'));
|
||||
return apply_filters('theme_root_uri', content_url('themes'), get_option('siteurl'));
|
||||
}
|
||||
|
||||
function get_query_template($type) {
|
||||
|
|
Loading…
Reference in New Issue