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. Built from https://develop.svn.wordpress.org/trunk@56352 git-svn-id: http://core.svn.wordpress.org/trunk@55864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user