Make WordPress Core


Ignore:
Timestamp:
10/18/2020 05:31:37 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Use instanceof instead of a comparison with get_class().

Includes adjusting external libraries which are no longer maintained externally.

Props jrf.
See #50767.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r49154 r49194  
    23912391
    23922392    // The only controller that works is the Terms controller.
    2393     if ( 'WP_REST_Terms_Controller' === get_class( $controller ) ) {
     2393    if ( $controller instanceof WP_REST_Terms_Controller ) {
    23942394        $namespace = 'wp/v2';
    23952395        $rest_base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;
Note: See TracChangeset for help on using the changeset viewer.