Skip to content

Commit

Permalink
Bootstrap/Load: Revert the is_*_admin_screen() aliases for `is_*_ad…
Browse files Browse the repository at this point in the history
…min()` function family.

After some further discussion, it is apparent that the added clarity was subjective, and the `_screen` suffix may not always be appropriate, e.g. in Ajax context. To address any confusion with the existing names, the documentation for these functions can be updated instead.

Additionally, the `is_super_admin_user()` alias for `is_super_admin()` is reverted as well, which may be reconsidered in the future.

Follow-up to [54259].

Props azaozz, jrf, johnbillion, manfcarlo, Clorith.
See #56400.

git-svn-id: https://develop.svn.wordpress.org/trunk@54332 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov authored and = committed Nov 4, 2022
1 parent 913f3df commit 6062e49
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 80 deletions.
16 changes: 0 additions & 16 deletions src/wp-includes/capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -1084,22 +1084,6 @@ function get_super_admins() {
}
}

/**
* Determines whether user is a site admin.
*
* @since 6.1.0
*
* This function is an alias for is_super_admin().
*
* @see is_super_admin()
*
* @param int|false $user_id Optional. The ID of a user. Defaults to false, to check the current user.
* @return bool Whether the user is a site admin.
*/
function is_super_admin_user( $user_id = false ) {
return is_super_admin( $user_id );
}

/**
* Determines whether user is a site admin.
*
Expand Down
64 changes: 0 additions & 64 deletions src/wp-includes/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -1154,21 +1154,6 @@ function is_login_screen() {
return false !== stripos( wp_login_url(), $_SERVER['SCRIPT_NAME'] );
}

/**
* Determines whether the current request is for an administrative interface page.
*
* This function is an alias for is_admin().
*
* @since 6.1.0
*
* @see is_admin()
*
* @return bool True if inside WordPress administration interface, false otherwise.
*/
function is_admin_screen() {
return is_admin();
}

/**
* Determines whether the current request is for an administrative interface page.
*
Expand All @@ -1195,21 +1180,6 @@ function is_admin() {
return false;
}

/**
* Determines whether the current request is for a site's administrative interface.
*
* This function is an alias for is_blog_admin().
*
* @since 6.1.0
*
* @see is_blog_admin()
*
* @return bool True if inside WordPress site administration pages.
*/
function is_site_admin_screen() {
return is_blog_admin();
}

/**
* Determines whether the current request is for a site's administrative interface.
*
Expand All @@ -1234,23 +1204,6 @@ function is_blog_admin() {
return false;
}

/**
* Determines whether the current request is for the network administrative interface.
*
* e.g. `/wp-admin/network/`
*
* This function is an alias for is_network_admin().
*
* @since 6.1.0
*
* @see is_network_admin()
*
* @return bool True if inside WordPress network administration pages.
*/
function is_network_admin_screen() {
return is_network_admin();
}

/**
* Determines whether the current request is for the network administrative interface.
*
Expand Down Expand Up @@ -1278,23 +1231,6 @@ function is_network_admin() {
return false;
}

/**
* Determines whether the current request is for a user admin screen.
*
* e.g. `/wp-admin/user/`
*
* This function is an alias for is_user_admin().
*
* @since 6.1.0
*
* @see is_user_admin()
*
* @return bool True if inside WordPress user administration pages.
*/
function is_user_admin_screen() {
return is_user_admin();
}

/**
* Determines whether the current request is for a user admin screen.
*
Expand Down

0 comments on commit 6062e49

Please sign in to comment.