Ticket #11242: r12294.diff
File r12294.diff, 3.0 KB (added by , 15 years ago) |
---|
-
wp-includes/template-loader.php
3 3 * Loads the correct template based on the visitor's url 4 4 * @package WordPress 5 5 */ 6 $template = null; 6 7 if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) { 7 8 do_action('template_redirect'); 8 9 if ( is_robots() ) { … … 12 13 do_feed(); 13 14 return; 14 15 } else if ( is_trackback() ) { 15 include(ABSPATH . 'wp-trackback.php'); 16 return; 16 $template = ABSPATH . 'wp-trackback.php'; 17 17 } else if ( is_404() && $template = get_404_template() ) { 18 include($template);19 return;20 18 } else if ( is_search() && $template = get_search_template() ) { 21 include($template);22 return;23 19 } else if ( is_tax() && $template = get_taxonomy_template()) { 24 include($template);25 return;26 20 } else if ( is_home() && $template = get_home_template() ) { 27 include($template);28 return;29 21 } else if ( is_attachment() && $template = get_attachment_template() ) { 30 22 remove_filter('the_content', 'prepend_attachment'); 31 include($template);32 return;33 23 } else if ( is_single() && $template = get_single_template() ) { 34 include($template);35 return;36 24 } else if ( is_page() && $template = get_page_template() ) { 37 include($template);38 return;39 25 } else if ( is_category() && $template = get_category_template()) { 40 include($template);41 return;42 26 } else if ( is_tag() && $template = get_tag_template()) { 43 include($template);44 return;45 27 } else if ( is_author() && $template = get_author_template() ) { 46 include($template);47 return;48 28 } else if ( is_date() && $template = get_date_template() ) { 49 include($template);50 return;51 29 } else if ( is_archive() && $template = get_archive_template() ) { 52 include($template);53 return;54 30 } else if ( is_comments_popup() && $template = get_comments_popup_template() ) { 55 include($template);56 return;57 31 } else if ( is_paged() && $template = get_paged_template() ) { 58 include($template);59 return;60 32 } else if ( file_exists(TEMPLATEPATH . "/index.php") ) { 61 include(TEMPLATEPATH . "/index.php"); 62 return; 33 $template = TEMPLATEPATH . "/index.php"; 63 34 } 64 35 } else { 65 36 // Process feeds and trackbacks even if not using themes. … … 70 41 do_feed(); 71 42 return; 72 43 } else if ( is_trackback() ) { 73 include(ABSPATH . 'wp-trackback.php'); 74 return; 44 $template = ABSPATH . 'wp-trackback.php'; 75 45 } 76 46 } 77 47 78 ?> 79 No newline at end of file 48 if ( $template = apply_filters('template_include', $template) ) 49 include($template); 50 51 ?> -
wp-includes/theme.php
991 991 if ( is_array($wp_query->query_vars) ) 992 992 extract($wp_query->query_vars, EXTR_SKIP); 993 993 994 require_once($_template_file); 994 if ( $_template_file = apply_filters('template_include',$_template_file) ) 995 require_once $_template_file; 995 996 } 996 997 997 998 /**