Skip to:
Content

bbPress.org

Changeset 5210


Ignore:
Timestamp:
11/27/2013 07:43:15 AM (8 years ago)
Author:
johnjamesjacoby
Message:

Windows (IIS) support for theme compatibility script and style functions. Props r-a-y, netweb. Fixes #2481. (2.5)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/includes/core/template-functions.php

    r5186 r5210  
    159159    if ( !empty( $located ) ) {
    160160
    161         // Make path to file relative to site URL
    162         $located = trailingslashit( site_url() ) . str_replace( ABSPATH, '', $located );
     161        $content_dir = constant( 'WP_CONTENT_DIR' );
     162 
     163        // IIS (Windows) here
     164        // Replace back slashes with forward slash
     165        if ( strpos( $located, '\\' ) !== false ) {
     166            $located     = str_replace( '\\', '/', $located     );
     167            $content_dir = str_replace( '\\', '/', $content_dir );
     168        }
     169
     170        // Make path to file relative to site URL
     171        $located = str_replace( $content_dir, WP_CONTENT_URL, $located );
    163172
    164173        // Enqueue the style
     
    218227    if ( !empty( $located ) ) {
    219228
    220         // Make path to file relative to site URL
    221         $located = trailingslashit( site_url() ) . str_replace( ABSPATH, '', $located );
     229        $content_dir = constant( 'WP_CONTENT_DIR' );
     230 
     231        // IIS (Windows) here
     232        // Replace back slashes with forward slash
     233        if ( strpos( $located, '\\' ) !== false ) {
     234            $located     = str_replace( '\\', '/', $located     );
     235            $content_dir = str_replace( '\\', '/', $content_dir );
     236        }
     237
     238        // Make path to file relative to site URL
     239        $located = str_replace( $content_dir, WP_CONTENT_URL, $located );
    222240
    223241        // Enqueue the style
Note: See TracChangeset for help on using the changeset viewer.