wpseek.com
WordPress开发者和主题制作者的搜索引擎
remove_allowed_options › WordPress Function
Since5.5.0
已弃用n/a
› remove_allowed_options ( $del_options, $options = '' )
| 参数: (2) |
|
| 返回: |
|
| 定义在: |
|
| 文档: |
Removes a list of options from the allowed options list.
Related Functions: remove_all_actions, add_allowed_options, remove_action, get_alloptions, remove_all_filters
源码
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;
}