Make WordPress Core


Ignore:
Timestamp:
01/26/2017 04:52:51 PM (10 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.

See #38792, #37738.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-term.php

    r38381 r39992  
    126126                global $wpdb;
    127127
    128                 if ( ! is_numeric( $term_id ) || $term_id != floor( $term_id ) || ! $term_id ) {
     128                $term_id = (int) $term_id;
     129                if ( ! $term_id ) {
    129130                        return false;
    130131                }
    131 
    132                 $term_id = (int) $term_id;
    133132
    134133                $_term = wp_cache_get( $term_id, 'terms' );
Note: See TracChangeset for help on using the changeset viewer.