| 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 | */ |
| 2074 | function 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 | /** |