mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Coding Standards: Use strict type check for in_array() and array_search().
This addresses all the remaining `WordPress.PHP.StrictInArray.MissingTrueStrict` issues in core. Includes minor code layout fixes for better readability. Follow-up to [47550]. See #49542. git-svn-id: https://develop.svn.wordpress.org/trunk@47557 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3687,13 +3687,15 @@ function get_dashboard_url( $user_id = 0, $path = '', $scheme = 'admin' ) {
|
||||
$user_id = $user_id ? (int) $user_id : get_current_user_id();
|
||||
|
||||
$blogs = get_blogs_of_user( $user_id );
|
||||
|
||||
if ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty( $blogs ) ) {
|
||||
$url = user_admin_url( $path, $scheme );
|
||||
} elseif ( ! is_multisite() ) {
|
||||
$url = admin_url( $path, $scheme );
|
||||
} else {
|
||||
$current_blog = get_current_blog_id();
|
||||
if ( $current_blog && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ) ) ) ) {
|
||||
|
||||
if ( $current_blog && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ), true ) ) ) {
|
||||
$url = admin_url( $path, $scheme );
|
||||
} else {
|
||||
$active = get_active_blog_for_user( $user_id );
|
||||
|
||||
Reference in New Issue
Block a user