[wp-cvs] wordpress/wp-includes functions.php, 1.258,
1.259 template-functions-general.php, 1.68, 1.69
Ryan Boren
rboren at users.sourceforge.net
Sat Feb 12 19:06:09 GMT 2005
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29891/wp-includes
Modified Files:
functions.php template-functions-general.php
Log Message:
Add theme directory location hooks.
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.258
retrieving revision 1.259
diff -C2 -d -r1.258 -r1.259
*** functions.php 12 Feb 2005 08:58:10 -0000 1.258
--- functions.php 12 Feb 2005 19:06:05 -0000 1.259
***************
*** 1268,1275 ****
--- 1268,1301 ----
}
+ 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'));
***************
*** 1278,1285 ****
function get_template_directory() {
$template = get_template();
! $template = ABSPATH . "wp-content/themes/$template";
!
! return $template;
}
--- 1304,1315 ----
function get_template_directory() {
$template = get_template();
+ $template_dir = get_theme_root() . "/$template";
+ return apply_filters('template_directory', $template_dir, $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);
}
***************
*** 1325,1330 ****
$themes = array();
$wp_broken_themes = array();
! $theme_loc = 'wp-content/themes';
! $theme_root = ABSPATH . $theme_loc;
// Files in wp-content/themes directory
--- 1355,1360 ----
$themes = array();
$wp_broken_themes = array();
! $theme_root = get_theme_root();
! $theme_loc = str_replace(ABSPATH, '', $theme_root);
// Files in wp-content/themes directory
Index: template-functions-general.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-general.php,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** template-functions-general.php 7 Feb 2005 07:37:53 -0000 1.68
--- template-functions-general.php 12 Feb 2005 19:06:06 -0000 1.69
***************
*** 97,111 ****
break;
case 'stylesheet_url':
! $output = get_stylesheet();
! $output = get_settings('siteurl') . "/wp-content/themes/$output/style.css";
break;
case 'stylesheet_directory':
! $output = get_stylesheet();
! $output = get_settings('siteurl') . "/wp-content/themes/$output";
break;
case 'template_directory':
case 'template_url':
! $output = get_template();
! $output = get_settings('siteurl') . "/wp-content/themes/$output";
break;
case 'admin_email':
--- 97,108 ----
break;
case 'stylesheet_url':
! $output = get_stylesheet_uri();
break;
case 'stylesheet_directory':
! $output = get_stylesheet_directory_uri();
break;
case 'template_directory':
case 'template_url':
! $output = get_template_directory_uri();
break;
case 'admin_email':
More information about the cvs
mailing list