Ticket #7086: 7086.diff
File 7086.diff, 6.9 KB (added by , 16 years ago) |
---|
-
wp-includes/theme.php
343 343 function get_query_template($type) { 344 344 $template = ''; 345 345 $type = preg_replace( '|[^a-z0-9-]+|', '', $type ); 346 if ( file_exists(TEMPLATEPATH . "/{$type}.php") ) 346 if ( file_exists(STYLESHEETPATH . "/{$type}.php") ) 347 $template = STYLESHEETPATH . "/{$type}.php"; 348 elseif ( file_exists(TEMPLATEPATH . "/{$type}.php") ) 347 349 $template = TEMPLATEPATH . "/{$type}.php"; 348 350 349 351 return apply_filters("{$type}_template", $template); … … 363 365 364 366 function get_category_template() { 365 367 $template = ''; 366 if ( file_exists(TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php') ) 368 if ( file_exists(STYLESHEETPATH . "/category-" . absint( get_query_var('cat') ) . '.php') ) 369 $template = STYLESHEETPATH . "/category-" . absint( get_query_var('cat') ) . '.php'; 370 elseif ( file_exists(TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php') ) 367 371 $template = TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php'; 372 elseif ( file_exists(STYLESHEETPATH . "/category.php") ) 373 $template = STYLESHEETPATH . "/category.php"; 368 374 elseif ( file_exists(TEMPLATEPATH . "/category.php") ) 369 375 $template = TEMPLATEPATH . "/category.php"; 370 376 … … 373 379 374 380 function get_tag_template() { 375 381 $template = ''; 376 if ( file_exists(TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php') ) 382 if ( file_exists(STYLESHEETPATH . "/tag-" . get_query_var('tag') . '.php') ) 383 $template = STYLESHEETPATH . "/tag-" . get_query_var('tag') . '.php'; 384 elseif ( file_exists(TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php') ) 377 385 $template = TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php'; 386 elseif ( file_exists(STYLESHEETPATH . "/tag.php") ) 387 $template = STYLESHEETPATH . "/tag.php"; 378 388 elseif ( file_exists(TEMPLATEPATH . "/tag.php") ) 379 389 $template = TEMPLATEPATH . "/tag.php"; 380 390 … … 385 395 $template = ''; 386 396 $taxonomy = get_query_var('taxonomy'); 387 397 $term = get_query_var('term'); 388 if ( $taxonomy && $term && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php") ) 398 if ( $taxonomy && $term && file_exists(STYLESHEETPATH . "/taxonomy-$taxonomy-$term.php") ) 399 $template = STYLESHEETPATH . "/taxonomy-$taxonomy-$term.php"; 400 elseif ( $taxonomy && $term && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php") ) 389 401 $template = TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php"; 402 elseif ( $taxonomy && file_exists(STYLESHEETPATH . "/taxonomy-$taxonomy.php") ) 403 $template = STYLESHEETPATH . "/taxonomy-$taxonomy.php"; 390 404 elseif ( $taxonomy && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy.php") ) 391 405 $template = TEMPLATEPATH . "/taxonomy-$taxonomy.php"; 406 elseif ( file_exists(STYLESHEETPATH . "/taxonomy.php") ) 407 $template = STYLESHEETPATH . "/taxonomy.php"; 392 408 elseif ( file_exists(TEMPLATEPATH . "/taxonomy.php") ) 393 409 $template = TEMPLATEPATH . "/taxonomy.php"; 394 410 … … 402 418 function get_home_template() { 403 419 $template = ''; 404 420 405 if ( file_exists(TEMPLATEPATH . "/home.php") ) 421 if ( file_exists(STYLESHEETPATH . "/home.php") ) 422 $template = STYLESHEETPATH . "/home.php"; 423 elseif ( file_exists(TEMPLATEPATH . "/home.php") ) 406 424 $template = TEMPLATEPATH . "/home.php"; 425 elseif ( file_exists(STYLESHEETPATH . "/index.php") ) 426 $template = STYLESHEETPATH . "/index.php"; 407 427 elseif ( file_exists(TEMPLATEPATH . "/index.php") ) 408 428 $template = TEMPLATEPATH . "/index.php"; 409 429 … … 419 439 if ( 'default' == $template ) 420 440 $template = ''; 421 441 422 if ( !empty($template) && !validate_file($template) && file_exists(TEMPLATEPATH . "/$template") ) 442 if ( !empty($template) && !validate_file($template) && file_exists(STYLESHEETPATH . "/$template") ) 443 $template = STYLESHEETPATH . "/$template"; 444 elseif ( !empty($template) && !validate_file($template) && file_exists(TEMPLATEPATH . "/$template") ) 423 445 $template = TEMPLATEPATH . "/$template"; 446 elseif ( file_exists(STYLESHEETPATH . "/page.php") ) 447 $template = STYLESHEETPATH . "/page.php"; 424 448 elseif ( file_exists(TEMPLATEPATH . "/page.php") ) 425 449 $template = TEMPLATEPATH . "/page.php"; 426 450 else … … 455 479 } 456 480 457 481 function get_comments_popup_template() { 458 if ( file_exists( TEMPLATEPATH . '/comments-popup.php') ) 482 if ( file_exists( STYLESHEETPATH . '/comments-popup.php') ) 483 $template = STYLESHEETPATH . '/comments-popup.php'; 484 elseif ( file_exists( TEMPLATEPATH . '/comments-popup.php') ) 459 485 $template = TEMPLATEPATH . '/comments-popup.php'; 460 486 else 461 487 $template = get_theme_root() . '/default/comments-popup.php'; -
wp-includes/comment-template.php
664 664 update_comment_cache($comments); 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 674 677 /** -
wp-includes/general-template.php
4 4 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 10 12 load_template( WP_CONTENT_DIR . '/themes/default/header.php'); … … 13 15 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 19 23 load_template( WP_CONTENT_DIR . '/themes/default/footer.php'); … … 22 26 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'); 29 37 else