]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-post.php
WordPress 4.7-scripts
[autoinstalls/wordpress.git] / wp-includes / class-wp-post.php
index 5904e588d04cf127b7ea087a31b8f3f13db823b4..c966934899b110507819c9818d102e9dddece9da 100644 (file)
@@ -210,9 +210,11 @@ final class WP_Post {
        public static function get_instance( $post_id ) {
                global $wpdb;
 
-               $post_id = (int) $post_id;
-               if ( ! $post_id )
+               if ( ! is_numeric( $post_id ) || $post_id != floor( $post_id ) || ! $post_id ) {
                        return false;
+               }
+
+               $post_id = (int) $post_id;
 
                $_post = wp_cache_get( $post_id, 'posts' );
 
@@ -252,7 +254,7 @@ final class WP_Post {
                        return true;
 
                if ( 'page_template' == $key )
-                       return ( 'page' == $this->post_type );
+                       return true;
 
                if ( 'post_category' == $key )
                   return true;