WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/26/2017 04:56:21 PM (5 years ago)
Author:
boonebgorges
Message:

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.

Merge of [39992] to the 4.7 branch.

See #38792, #37738.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/class-wp-comment.php

    r38381 r39993  
    192192        global $wpdb;
    193193
    194         if ( ! is_numeric( $id ) || $id != floor( $id ) || ! $id ) {
     194        $comment_id = (int) $id;
     195        if ( ! $comment_id ) {
    195196            return false;
    196197        }
    197 
    198         $comment_id = (int) $id;
    199198
    200199        $_comment = wp_cache_get( $comment_id, 'comment' );
Note: See TracChangeset for help on using the changeset viewer.