Add theme directory location hooks.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2005-02-12 19:06:06 +00:00
parent b698cac8ee
commit e509af852c
2 changed files with 38 additions and 11 deletions

View File

@ -1267,20 +1267,50 @@ function the_post() {
$wp_query->the_post();
}
function get_theme_root() {
return apply_filters('theme_root', ABSPATH . "wp-content/themes");
}
function get_theme_root_uri() {
return apply_filters('theme_root_uri', get_settings('siteurl') . "/wp-content/themes", get_settings('siteurl'));
}
function get_stylesheet() {
return apply_filters('stylesheet', get_settings('stylesheet'));
}
function get_stylesheet_directory() {
$stylesheet = get_stylesheet();
$stylesheet_dir = get_theme_root() . "/$stylesheet";
return apply_filters('stylesheet_directory', $stylesheet_dir, $stylesheet);
}
function get_stylesheet_directory_uri() {
$stylesheet = get_stylesheet();
$stylesheet_dir_uri = get_theme_root_uri() . "/$stylesheet";
return apply_filters('stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet);
}
function get_stylesheet_uri() {
$stylesheet_dir_uri = get_stylesheet_directory_uri();
$stylesheet_uri = $stylesheet_dir_uri . "/style.css";
return apply_filters('stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri);
}
function get_template() {
return apply_filters('template', get_settings('template'));
}
function get_template_directory() {
$template = get_template();
$template_dir = get_theme_root() . "/$template";
return apply_filters('template_directory', $template_dir, $template);
}
$template = ABSPATH . "wp-content/themes/$template";
return $template;
function get_template_directory_uri() {
$template = get_template();
$template_dir_uri = get_theme_root_uri() . "/$template";
return apply_filters('template_directory_uri', $template_dir_uri, $template);
}
function get_theme_data($theme_file) {
@ -1324,8 +1354,8 @@ function get_themes() {
$themes = array();
$wp_broken_themes = array();
$theme_loc = 'wp-content/themes';
$theme_root = ABSPATH . $theme_loc;
$theme_root = get_theme_root();
$theme_loc = str_replace(ABSPATH, '', $theme_root);
// Files in wp-content/themes directory
$themes_dir = @ dir($theme_root);

View File

@ -96,17 +96,14 @@ function get_bloginfo($show='') {
$output = get_settings('siteurl') .'/xmlrpc.php';
break;
case 'stylesheet_url':
$output = get_stylesheet();
$output = get_settings('siteurl') . "/wp-content/themes/$output/style.css";
$output = get_stylesheet_uri();
break;
case 'stylesheet_directory':
$output = get_stylesheet();
$output = get_settings('siteurl') . "/wp-content/themes/$output";
$output = get_stylesheet_directory_uri();
break;
case 'template_directory':
case 'template_url':
$output = get_template();
$output = get_settings('siteurl') . "/wp-content/themes/$output";
$output = get_template_directory_uri();
break;
case 'admin_email':
$output = get_settings('admin_email');