Changeset 13032 for trunk/wp-includes/theme.php
- Timestamp:
- 02/08/2010 10:05:05 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/theme.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r13020 r13032 861 861 global $wp_query; 862 862 863 $id = (int) $wp_query-> post->ID;863 $id = (int) $wp_query->get_queried_object_id(); 864 864 $template = get_post_meta($id, '_wp_page_template', true); 865 865 $pagename = get_query_var('pagename'); … … 910 910 */ 911 911 function get_single_template() { 912 return get_query_template('single'); 912 global $wp_query; 913 914 $object = $wp_query->get_queried_object(); 915 $templates = array('single-' . $object->post_type . '.php', 'single.php'); 916 return apply_filters('single_template', locate_template($templates)); 913 917 } 914 918 … … 975 979 */ 976 980 function locate_template($template_names, $load = false) { 977 if ( !is_array($template_names))981 if ( !is_array($template_names) ) 978 982 return ''; 979 983 980 984 $located = ''; 981 foreach ($template_names as $template_name) {985 foreach ( $template_names as $template_name ) { 982 986 if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { 983 987 $located = STYLESHEETPATH . '/' . $template_name; … … 989 993 } 990 994 991 if ( $load && '' != $located)995 if ( $load && '' != $located ) 992 996 load_template($located); 993 997
Note: See TracChangeset
for help on using the changeset viewer.