]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-post.php
WordPress 4.7.2
[autoinstalls/wordpress.git] / wp-includes / class-wp-post.php
index c966934899b110507819c9818d102e9dddece9da..edaf149a3f69618931034a397721762252a0509f 100644 (file)
@@ -210,12 +210,11 @@ final class WP_Post {
        public static function get_instance( $post_id ) {
                global $wpdb;
 
-               if ( ! is_numeric( $post_id ) || $post_id != floor( $post_id ) || ! $post_id ) {
+               $post_id = (int) $post_id;
+               if ( ! $post_id ) {
                        return false;
                }
 
-               $post_id = (int) $post_id;
-
                $_post = wp_cache_get( $post_id, 'posts' );
 
                if ( ! $_post ) {