On this page
remove_allowed_options( array $del_options, string|array $options = '' ): array
Removes a list of options from the allowed options list.
Parameters
$del_optionsarray Required$optionsstring|array Optional-
Default:
''
Return
array
Source
File: wp-admin/includes/plugin.php. View all references
function remove_allowed_options( $del_options, $options = '' ) {
if ( '' === $options ) {
global $allowed_options;
} else {
$allowed_options = $options;
}
foreach ( $del_options as $page => $keys ) {
foreach ( $keys as $key ) {
if ( isset( $allowed_options[ $page ] ) && is_array( $allowed_options[ $page ] ) ) {
$pos = array_search( $key, $allowed_options[ $page ], true );
if ( false !== $pos ) {
unset( $allowed_options[ $page ][ $pos ] );
}
}
}
}
return $allowed_options;
}
Related
Used By
| Used By | Description |
|---|---|
| remove_option_whitelist() wp-includes/deprecated.php | Removes a list of options from the allowed options list. |
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/remove_allowed_options