Make WordPress Core


Ignore:
Timestamp:
10/18/2020 05:31:37 PM (4 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/class-json.php

    r49108 r49194  
    919919        if (class_exists('pear')) {
    920920            return PEAR::isError($data, $code);
    921         } elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
     921        } elseif (is_object($data) && ($data instanceof services_json_error ||
    922922                                 is_subclass_of($data, 'services_json_error'))) {
    923923            return true;
Note: See TracChangeset for help on using the changeset viewer.