Ticket #23202: 23202.patch
File 23202.patch, 779 bytes (added by , 13 years ago) |
---|
-
wp-includes/post-template.php
1244 1244 * @return bool False on failure, true if success. 1245 1245 */ 1246 1246 function is_page_template( $template = '' ) { 1247 if ( ! is_page() )1247 if ( ! is_page() && ! in_the_loop() ) { 1248 1248 return false; 1249 } elseif ( in_the_loop() ) { 1250 global $wp_the_query; 1251 $page_template = get_page_template_slug( $wp_the_query->queried_object_id ); 1252 } 1253 else { 1254 $page_template = get_page_template_slug( get_queried_object_id() ); 1255 } 1249 1256 1250 $page_template = get_page_template_slug( get_queried_object_id() );1251 1252 1257 if ( empty( $template ) ) 1253 1258 return (bool) $page_template; 1254 1259