Changeset 11545 for trunk/wp-includes/theme.php
- Timestamp:
- 06/10/2009 04:36:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r11450 r11545 1135 1135 } 1136 1136 1137 /**1138 * Get the basename of a theme.1139 *1140 * This method extracts the filename of a theme file from a path1141 *1142 * @package WordPress1143 * @subpackage Plugin1144 * @since 2.8.01145 *1146 * @access private1147 *1148 * @param string $file The filename of a theme file1149 * @return string The filename relative to the themes folder1150 */1151 function theme_basename($file) {1152 $file = str_replace('\\','/',$file); // sanitize for Win32 installs1153 $file = preg_replace('|/+|','/', $file); // remove any duplicate slash1154 $theme_dir = str_replace('\\','/', get_theme_root()); // sanitize for Win32 installs1155 $theme_dir = preg_replace('|/+|','/', $theme_dir); // remove any duplicate slash1156 $file = preg_replace('|^.*/themes/.*?/|','',$file); // get relative path from theme dir1157 return $file;1158 }1159 1160 1137 ?>
Note: See TracChangeset
for help on using the changeset viewer.