mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Revert to pre-4.7 behavior for fetching object instances by id.
This changeset reverts [38381], which caused inconsistencies in the way the REST API fetches posts and other objects. See #38792, #37738. git-svn-id: https://develop.svn.wordpress.org/trunk@39992 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user