函数原型
remove_allowed_options( array $del_options, string|array $options = ” ): array
函数描述
Removes a list of options from the allowed options list.
是否弃用
未弃用
函数参数
-
$del_options
array
Required -
$options
string|array
Optional Default:
''
函数返回值
array
函数位置
File: wp-admin/includes/plugin.php.
函数源码
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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |

