Ticket #24250: 24250.diff
File 24250.diff, 944 bytes (added by , 10 years ago) |
---|
-
wp-includes/post-template.php
1275 1275 * 1276 1276 * @since 3.4.0 1277 1277 * 1278 * @param int $post_id The page ID to check. Defaults to the current post, when used in the loop.1278 * @param int|null $post_id The page ID to check. Defaults to the current post, when used in the loop. 1279 1279 * @return string|bool Page template filename. Returns an empty string when the default page template 1280 1280 * is in use. Returns false if the post is not a page. 1281 1281 */ 1282 1282 function get_page_template_slug( $post_id = null ) { 1283 1283 $post = get_post( $post_id ); 1284 if ( 'page' != $post->post_type )1284 if ( ! isset( $post->post_type ) || 'page' != $post->post_type ) 1285 1285 return false; 1286 1286 $template = get_post_meta( $post->ID, '_wp_page_template', true ); 1287 1287 if ( ! $template || 'default' == $template )