diff --git a/src/wp-content/themes/twentyseventeen/inc/template-tags.php b/src/wp-content/themes/twentyseventeen/inc/template-tags.php index 437ebd4241..cd0afb7e3e 100644 --- a/src/wp-content/themes/twentyseventeen/inc/template-tags.php +++ b/src/wp-content/themes/twentyseventeen/inc/template-tags.php @@ -140,7 +140,7 @@ endif; * @param int $id Front page section to display. */ function twentyseventeen_front_page_section( $partial = null, $id = 0 ) { - if ( is_a( $partial, 'WP_Customize_Partial' ) ) { + if ( $partial instanceof WP_Customize_Partial ) { // Find out the ID and set it up during a selective refresh. global $twentyseventeencounter; diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php index a35051ac8b..d1d438d9e5 100644 --- a/src/wp-includes/admin-bar.php +++ b/src/wp-includes/admin-bar.php @@ -897,7 +897,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { ) ); } - } elseif ( is_a( $current_object, 'WP_User' ) && current_user_can( 'edit_user', $current_object->ID ) ) { + } elseif ( $current_object instanceof WP_User && current_user_can( 'edit_user', $current_object->ID ) ) { $edit_user_link = get_edit_user_link( $current_object->ID ); if ( $edit_user_link ) { $wp_admin_bar->add_node( diff --git a/src/wp-includes/http.php b/src/wp-includes/http.php index c00d1f7e03..e1738beedf 100644 --- a/src/wp-includes/http.php +++ b/src/wp-includes/http.php @@ -354,7 +354,7 @@ function wp_remote_retrieve_cookie( $response, $name ) { function wp_remote_retrieve_cookie_value( $response, $name ) { $cookie = wp_remote_retrieve_cookie( $response, $name ); - if ( ! is_a( $cookie, 'WP_Http_Cookie' ) ) { + if ( ! ( $cookie instanceof WP_Http_Cookie ) ) { return ''; } diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index 9b25e49aa9..0ee3a0d615 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -4032,7 +4032,7 @@ function _wp_privacy_account_request_confirmed( $request_id ) { function _wp_privacy_send_request_confirmation_notification( $request_id ) { $request = wp_get_user_request( $request_id ); - if ( ! is_a( $request, 'WP_User_Request' ) || 'request-confirmed' !== $request->status ) { + if ( ! ( $request instanceof WP_User_Request ) || 'request-confirmed' !== $request->status ) { return; } @@ -4244,7 +4244,7 @@ All at ###SITENAME### function _wp_privacy_send_erasure_fulfillment_notification( $request_id ) { $request = wp_get_user_request( $request_id ); - if ( ! is_a( $request, 'WP_User_Request' ) || 'request-completed' !== $request->status ) { + if ( ! ( $request instanceof WP_User_Request ) || 'request-completed' !== $request->status ) { return; } diff --git a/src/wp-login.php b/src/wp-login.php index 8810f5d0d8..3dbfacfd2b 100644 --- a/src/wp-login.php +++ b/src/wp-login.php @@ -1303,7 +1303,7 @@ switch ( $action ) { } // Check if it is time to add a redirect to the admin email confirmation screen. - if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) { + if ( $user instanceof WP_User && $user->exists() && $user->has_cap( 'manage_options' ) ) { $admin_email_lifespan = (int) get_option( 'admin_email_lifespan' ); /* diff --git a/tests/phpunit/includes/testcase-rest-api.php b/tests/phpunit/includes/testcase-rest-api.php index 45e7c5e145..54644f13fb 100644 --- a/tests/phpunit/includes/testcase-rest-api.php +++ b/tests/phpunit/includes/testcase-rest-api.php @@ -3,7 +3,7 @@ abstract class WP_Test_REST_TestCase extends WP_UnitTestCase { protected function assertErrorResponse( $code, $response, $status = null ) { - if ( is_a( $response, 'WP_REST_Response' ) ) { + if ( $response instanceof WP_REST_Response ) { $response = $response->as_error(); } diff --git a/tests/phpunit/tests/actions.php b/tests/phpunit/tests/actions.php index 67222c0819..2f0daaa6a0 100644 --- a/tests/phpunit/tests/actions.php +++ b/tests/phpunit/tests/actions.php @@ -535,7 +535,7 @@ class Tests_Actions extends WP_UnitTestCase { foreach ( $hook as $priority => $filter ) { foreach ( $filter as $identifier => $function ) { if ( is_array( $function ) - && is_a( $function['function'][0], 'MockAction' ) + && $function['function'][0] instanceof MockAction && 'action' === $function['function'][1] ) { remove_filter(