Changeset 8497
- Timestamp:
- 07/30/2008 06:21:14 AM (16 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment-template.php
r8164 r8497 665 665 666 666 define('COMMENTS_TEMPLATE', true); 667 $include = apply_filters('comments_template', TEMPLATEPATH . $file ); 667 668 $include = apply_filters('comments_template', STYLESHEETPATH . $file ); 668 669 if ( file_exists( $include ) ) 669 670 require( $include ); 671 elseif ( file_exists( TEMPLATEPATH . $file ) ) 672 require( TEMPLATEPATH . $file ); 670 673 else 671 require( WP_CONTENT_DIR . '/themes/default/comments.php');674 require( get_theme_root() . '/default/comments.php'); 672 675 } 673 676 -
trunk/wp-includes/general-template.php
r8415 r8497 5 5 function get_header() { 6 6 do_action( 'get_header' ); 7 if ( file_exists( TEMPLATEPATH . '/header.php') ) 7 if ( file_exists( STYLESHEETPATH . '/header.php') ) 8 load_template( STYLESHEETPATH . '/header.php'); 9 elseif ( file_exists( TEMPLATEPATH . '/header.php') ) 8 10 load_template( TEMPLATEPATH . '/header.php'); 9 11 else … … 14 16 function get_footer() { 15 17 do_action( 'get_footer' ); 16 if ( file_exists( TEMPLATEPATH . '/footer.php') ) 18 if ( file_exists( STYLESHEETPATH . '/footer.php') ) 19 load_template( STYLESHEETPATH . '/footer.php'); 20 elseif ( file_exists( TEMPLATEPATH . '/footer.php') ) 17 21 load_template( TEMPLATEPATH . '/footer.php'); 18 22 else … … 23 27 function get_sidebar( $name = null ) { 24 28 do_action( 'get_sidebar' ); 25 if ( isset($name) && file_exists( TEMPLATEPATH . "/sidebar-{$name}.php") ) 29 if ( isset($name) && file_exists( STYLESHEETPATH . "/sidebar-{$name}.php") ) 30 load_template( STYLESHEETPATH . "/sidebar-{$name}.php"); 31 elseif ( isset($name) && file_exists( TEMPLATEPATH . "/sidebar-{$name}.php") ) 26 32 load_template( TEMPLATEPATH . "/sidebar-{$name}.php"); 33 elseif ( file_exists( STYLESHEETPATH . '/sidebar.php') ) 34 load_template( STYLESHEETPATH . '/sidebar.php'); 27 35 elseif ( file_exists( TEMPLATEPATH . '/sidebar.php') ) 28 36 load_template( TEMPLATEPATH . '/sidebar.php'); -
trunk/wp-includes/theme.php
r8485 r8497 233 233 234 234 $stylesheet_files = array(); 235 $template_files = array(); 236 235 237 $stylesheet_dir = @ dir("$theme_root/$stylesheet"); 236 238 if ( $stylesheet_dir ) { 237 239 while ( ($file = $stylesheet_dir->read()) !== false ) { 238 if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file) ) 239 $stylesheet_files[] = "$theme_loc/$stylesheet/$file"; 240 } 241 } 242 243 $template_files = array(); 240 if ( !preg_match('|^\.+$|', $file) ) { 241 if ( preg_match('|\.css$|', $file) ) 242 $stylesheet_files[] = "$theme_loc/$stylesheet/$file"; 243 elseif ( preg_match('|\.php$|', $file) ) 244 $template_files[] = "$theme_loc/$stylesheet/$file"; 245 } 246 } 247 } 248 244 249 $template_dir = @ dir("$theme_root/$template"); 245 250 if ( $template_dir ) { … … 344 349 $template = ''; 345 350 $type = preg_replace( '|[^a-z0-9-]+|', '', $type ); 346 if ( file_exists(TEMPLATEPATH . "/{$type}.php") ) 351 if ( file_exists(STYLESHEETPATH . "/{$type}.php") ) 352 $template = STYLESHEETPATH . "/{$type}.php"; 353 elseif ( file_exists(TEMPLATEPATH . "/{$type}.php") ) 347 354 $template = TEMPLATEPATH . "/{$type}.php"; 348 355 … … 364 371 function get_category_template() { 365 372 $template = ''; 366 if ( file_exists(TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php') ) 373 if ( file_exists(STYLESHEETPATH . "/category-" . absint( get_query_var('cat') ) . '.php') ) 374 $template = STYLESHEETPATH . "/category-" . absint( get_query_var('cat') ) . '.php'; 375 elseif ( file_exists(TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php') ) 367 376 $template = TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php'; 377 elseif ( file_exists(STYLESHEETPATH . "/category.php") ) 378 $template = STYLESHEETPATH . "/category.php"; 368 379 elseif ( file_exists(TEMPLATEPATH . "/category.php") ) 369 380 $template = TEMPLATEPATH . "/category.php"; … … 374 385 function get_tag_template() { 375 386 $template = ''; 376 if ( file_exists(TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php') ) 387 if ( file_exists(STYLESHEETPATH . "/tag-" . get_query_var('tag') . '.php') ) 388 $template = STYLESHEETPATH . "/tag-" . get_query_var('tag') . '.php'; 389 elseif ( file_exists(TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php') ) 377 390 $template = TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php'; 391 elseif ( file_exists(STYLESHEETPATH . "/tag.php") ) 392 $template = STYLESHEETPATH . "/tag.php"; 378 393 elseif ( file_exists(TEMPLATEPATH . "/tag.php") ) 379 394 $template = TEMPLATEPATH . "/tag.php"; … … 386 401 $taxonomy = get_query_var('taxonomy'); 387 402 $term = get_query_var('term'); 388 if ( $taxonomy && $term && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php") ) 403 if ( $taxonomy && $term && file_exists(STYLESHEETPATH . "/taxonomy-$taxonomy-$term.php") ) 404 $template = STYLESHEETPATH . "/taxonomy-$taxonomy-$term.php"; 405 elseif ( $taxonomy && $term && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php") ) 389 406 $template = TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php"; 407 elseif ( $taxonomy && file_exists(STYLESHEETPATH . "/taxonomy-$taxonomy.php") ) 408 $template = STYLESHEETPATH . "/taxonomy-$taxonomy.php"; 390 409 elseif ( $taxonomy && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy.php") ) 391 410 $template = TEMPLATEPATH . "/taxonomy-$taxonomy.php"; 411 elseif ( file_exists(STYLESHEETPATH . "/taxonomy.php") ) 412 $template = STYLESHEETPATH . "/taxonomy.php"; 392 413 elseif ( file_exists(TEMPLATEPATH . "/taxonomy.php") ) 393 414 $template = TEMPLATEPATH . "/taxonomy.php"; … … 403 424 $template = ''; 404 425 405 if ( file_exists(TEMPLATEPATH . "/home.php") ) 426 if ( file_exists(STYLESHEETPATH . "/home.php") ) 427 $template = STYLESHEETPATH . "/home.php"; 428 elseif ( file_exists(TEMPLATEPATH . "/home.php") ) 406 429 $template = TEMPLATEPATH . "/home.php"; 430 elseif ( file_exists(STYLESHEETPATH . "/index.php") ) 431 $template = STYLESHEETPATH . "/index.php"; 407 432 elseif ( file_exists(TEMPLATEPATH . "/index.php") ) 408 433 $template = TEMPLATEPATH . "/index.php"; … … 420 445 $template = ''; 421 446 422 if ( !empty($template) && !validate_file($template) && file_exists(TEMPLATEPATH . "/$template") ) 447 if ( !empty($template) && !validate_file($template) && file_exists(STYLESHEETPATH . "/$template") ) 448 $template = STYLESHEETPATH . "/$template"; 449 elseif ( !empty($template) && !validate_file($template) && file_exists(TEMPLATEPATH . "/$template") ) 423 450 $template = TEMPLATEPATH . "/$template"; 451 elseif ( file_exists(STYLESHEETPATH . "/page.php") ) 452 $template = STYLESHEETPATH . "/page.php"; 424 453 elseif ( file_exists(TEMPLATEPATH . "/page.php") ) 425 454 $template = TEMPLATEPATH . "/page.php"; … … 456 485 457 486 function get_comments_popup_template() { 458 if ( file_exists( TEMPLATEPATH . '/comments-popup.php') ) 487 if ( file_exists( STYLESHEETPATH . '/comments-popup.php') ) 488 $template = STYLESHEETPATH . '/comments-popup.php'; 489 elseif ( file_exists( TEMPLATEPATH . '/comments-popup.php') ) 459 490 $template = TEMPLATEPATH . '/comments-popup.php'; 460 491 else
Note: See TracChangeset
for help on using the changeset viewer.