Ticket #18750: 18750.4.diff
| File 18750.4.diff, 1.5 KB (added by , 14 years ago) |
|---|
-
wp-includes/post-template.php
1250 1250 1251 1251 global $wp_query; 1252 1252 1253 $page = $wp_query->get_queried_object(); 1254 $custom_fields = get_post_custom_values('_wp_page_template',$page->ID); 1255 $page_template = $custom_fields[0]; 1253 $page_template = get_custom_page_template(); 1256 1254 1257 1255 // We have no argument passed so just see if a page_template has been specified 1258 1256 if ( empty( $template ) ) { … … 1267 1265 } 1268 1266 1269 1267 /** 1268 * Get the specific template name for a page. 1269 * 1270 * @param int $id The page ID to check. If not provided, will use current page 1271 * @return string The specific template name if success, bool False on failure 1272 */ 1273 function get_custom_page_template( $id = '' ) { 1274 1275 if ( empty( $id ) && is_page() ) 1276 $id = get_queried_object_id(); 1277 1278 return get_post_meta( $id, '_wp_page_template', true ); 1279 } 1280 1281 /** 1270 1282 * Retrieve formatted date timestamp of a revision (linked to that revisions's page). 1271 1283 * 1272 1284 * @package WordPress -
wp-includes/theme.php
947 947 */ 948 948 function get_page_template() { 949 949 $id = get_queried_object_id(); 950 $template = get_ post_meta($id, '_wp_page_template', true);950 $template = get_custom_page_template(); 951 951 $pagename = get_query_var('pagename'); 952 952 953 953 if ( !$pagename && $id > 0 ) {