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:
Boone Gorges
2017-01-26 16:52:51 +00:00
parent 0167cea791
commit 18e09d246e
6 changed files with 6 additions and 120 deletions
+2 -3
View File
@@ -191,12 +191,11 @@ final class WP_Comment {
public static function get_instance( $id ) {
global $wpdb;
if ( ! is_numeric( $id ) || $id != floor( $id ) || ! $id ) {
$comment_id = (int) $id;
if ( ! $comment_id ) {
return false;
}
$comment_id = (int) $id;
$_comment = wp_cache_get( $comment_id, 'comment' );
if ( ! $_comment ) {