Edit File by line
/home/barbar84/www/wp-inclu...
File: capabilities.php
[1000] Fix | Delete
$user = get_userdata( $user_id );
[1001] Fix | Delete
if ( $user && 0 !== strcasecmp( $user->user_email, get_site_option( 'admin_email' ) ) ) {
[1002] Fix | Delete
$key = array_search( $user->user_login, $super_admins, true );
[1003] Fix | Delete
if ( false !== $key ) {
[1004] Fix | Delete
unset( $super_admins[ $key ] );
[1005] Fix | Delete
update_site_option( 'site_admins', $super_admins );
[1006] Fix | Delete
[1007] Fix | Delete
/**
[1008] Fix | Delete
* Fires after the user's Super Admin privileges are revoked.
[1009] Fix | Delete
*
[1010] Fix | Delete
* @since 3.0.0
[1011] Fix | Delete
*
[1012] Fix | Delete
* @param int $user_id ID of the user Super Admin privileges were revoked from.
[1013] Fix | Delete
*/
[1014] Fix | Delete
do_action( 'revoked_super_admin', $user_id );
[1015] Fix | Delete
return true;
[1016] Fix | Delete
}
[1017] Fix | Delete
}
[1018] Fix | Delete
return false;
[1019] Fix | Delete
}
[1020] Fix | Delete
[1021] Fix | Delete
/**
[1022] Fix | Delete
* Filters the user capabilities to grant the 'install_languages' capability as necessary.
[1023] Fix | Delete
*
[1024] Fix | Delete
* A user must have at least one out of the 'update_core', 'install_plugins', and
[1025] Fix | Delete
* 'install_themes' capabilities to qualify for 'install_languages'.
[1026] Fix | Delete
*
[1027] Fix | Delete
* @since 4.9.0
[1028] Fix | Delete
*
[1029] Fix | Delete
* @param bool[] $allcaps An array of all the user's capabilities.
[1030] Fix | Delete
* @return bool[] Filtered array of the user's capabilities.
[1031] Fix | Delete
*/
[1032] Fix | Delete
function wp_maybe_grant_install_languages_cap( $allcaps ) {
[1033] Fix | Delete
if ( ! empty( $allcaps['update_core'] ) || ! empty( $allcaps['install_plugins'] ) || ! empty( $allcaps['install_themes'] ) ) {
[1034] Fix | Delete
$allcaps['install_languages'] = true;
[1035] Fix | Delete
}
[1036] Fix | Delete
[1037] Fix | Delete
return $allcaps;
[1038] Fix | Delete
}
[1039] Fix | Delete
[1040] Fix | Delete
/**
[1041] Fix | Delete
* Filters the user capabilities to grant the 'resume_plugins' and 'resume_themes' capabilities as necessary.
[1042] Fix | Delete
*
[1043] Fix | Delete
* @since 5.2.0
[1044] Fix | Delete
*
[1045] Fix | Delete
* @param bool[] $allcaps An array of all the user's capabilities.
[1046] Fix | Delete
* @return bool[] Filtered array of the user's capabilities.
[1047] Fix | Delete
*/
[1048] Fix | Delete
function wp_maybe_grant_resume_extensions_caps( $allcaps ) {
[1049] Fix | Delete
// Even in a multisite, regular administrators should be able to resume plugins.
[1050] Fix | Delete
if ( ! empty( $allcaps['activate_plugins'] ) ) {
[1051] Fix | Delete
$allcaps['resume_plugins'] = true;
[1052] Fix | Delete
}
[1053] Fix | Delete
[1054] Fix | Delete
// Even in a multisite, regular administrators should be able to resume themes.
[1055] Fix | Delete
if ( ! empty( $allcaps['switch_themes'] ) ) {
[1056] Fix | Delete
$allcaps['resume_themes'] = true;
[1057] Fix | Delete
}
[1058] Fix | Delete
[1059] Fix | Delete
return $allcaps;
[1060] Fix | Delete
}
[1061] Fix | Delete
[1062] Fix | Delete
/**
[1063] Fix | Delete
* Filters the user capabilities to grant the 'view_site_health_checks' capabilities as necessary.
[1064] Fix | Delete
*
[1065] Fix | Delete
* @since 5.2.2
[1066] Fix | Delete
*
[1067] Fix | Delete
* @param bool[] $allcaps An array of all the user's capabilities.
[1068] Fix | Delete
* @param string[] $caps Required primitive capabilities for the requested capability.
[1069] Fix | Delete
* @param array $args {
[1070] Fix | Delete
* Arguments that accompany the requested capability check.
[1071] Fix | Delete
*
[1072] Fix | Delete
* @type string $0 Requested capability.
[1073] Fix | Delete
* @type int $1 Concerned user ID.
[1074] Fix | Delete
* @type mixed ...$2 Optional second and further parameters, typically object ID.
[1075] Fix | Delete
* }
[1076] Fix | Delete
* @param WP_User $user The user object.
[1077] Fix | Delete
* @return bool[] Filtered array of the user's capabilities.
[1078] Fix | Delete
*/
[1079] Fix | Delete
function wp_maybe_grant_site_health_caps( $allcaps, $caps, $args, $user ) {
[1080] Fix | Delete
if ( ! empty( $allcaps['install_plugins'] ) && ( ! is_multisite() || is_super_admin( $user->ID ) ) ) {
[1081] Fix | Delete
$allcaps['view_site_health_checks'] = true;
[1082] Fix | Delete
}
[1083] Fix | Delete
[1084] Fix | Delete
return $allcaps;
[1085] Fix | Delete
}
[1086] Fix | Delete
[1087] Fix | Delete
return;
[1088] Fix | Delete
[1089] Fix | Delete
// Dummy gettext calls to get strings in the catalog.
[1090] Fix | Delete
/* translators: User role for administrators. */
[1091] Fix | Delete
_x( 'Administrator', 'User role' );
[1092] Fix | Delete
/* translators: User role for editors. */
[1093] Fix | Delete
_x( 'Editor', 'User role' );
[1094] Fix | Delete
/* translators: User role for authors. */
[1095] Fix | Delete
_x( 'Author', 'User role' );
[1096] Fix | Delete
/* translators: User role for contributors. */
[1097] Fix | Delete
_x( 'Contributor', 'User role' );
[1098] Fix | Delete
/* translators: User role for subscribers. */
[1099] Fix | Delete
_x( 'Subscriber', 'User role' );
[1100] Fix | Delete
[1101] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function