Make WordPress Core


Ignore:
Timestamp:
08/03/2023 12:08:30 PM (13 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use instanceof keyword instead of the is_a() function.

This is a micro-optimization that removes a few unnecessary function calls.

Follow-up to [31188], [34369], [38986], [41159], [43211], [43230], [44606], [45757].

Props ayeshrajans, jrf, rajinsharwar, costdev, mukesh27, SergeyBiryukov.
Fixes #58943.

File:
1 edited

Legend:

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

    r56194 r56352  
    40334033    $request = wp_get_user_request( $request_id );
    40344034
    4035     if ( ! is_a( $request, 'WP_User_Request' ) || 'request-confirmed' !== $request->status ) {
     4035    if ( ! ( $request instanceof WP_User_Request ) || 'request-confirmed' !== $request->status ) {
    40364036        return;
    40374037    }
     
    42454245    $request = wp_get_user_request( $request_id );
    42464246
    4247     if ( ! is_a( $request, 'WP_User_Request' ) || 'request-completed' !== $request->status ) {
     4247    if ( ! ( $request instanceof WP_User_Request ) || 'request-completed' !== $request->status ) {
    42484248        return;
    42494249    }
Note: See TracChangeset for help on using the changeset viewer.