WordPress.org

Make WordPress Core

Ticket #18302: 18302.theme_url.4.diff

File 18302.theme_url.4.diff, 1.0 KB (added by georgestephanis, 9 years ago)
  • wp-includes/link-template.php

     
    20612061}
    20622062
    20632063/**
     2064 * Retrieve the url of the template file.
     2065 *
     2066 * Searches in the stylesheet directory before the template directory so themes
     2067 * which inherit from a parent theme can just overload one file.
     2068 *
     2069 * @since 3.5
     2070 *
     2071 * @param string $template_names Template file to search for.
     2072 * @return string The URI of the file if one is located.
     2073 */
     2074function theme_url( $file ) {
     2075        if ( ( TEMPLATEPATH !== STYLESHEETPATH ) && file_exists( trailingslashit( STYLESHEETPATH ) . $file ) ) {
     2076                $url = trailingslashit( get_stylesheet_directory_uri() ) . $file;
     2077        } else {
     2078                $url = trailingslashit( get_template_directory_uri() ) . $file;
     2079        }
     2080
     2081        return apply_filters( 'theme_url', $url, $file );
     2082}
     2083
     2084/**
    20642085 * Retrieve the site url for the current network.
    20652086 *
    20662087 * Returns the site url with the appropriate protocol, 'https' if