allowed_options
最后更新于:2021-11-25 20:23:47
apply_filters( ‘allowed_options’, array $allowed_options )
Filters the allowed options list.
参数
- $allowed_options
-
(array)
The allowed options list.
源文件
文件: gc-admin/options.php
$sections = array( 'section-one' => array( 'option-one', 'option-two' ), 'section-two' => array( 'option-one', 'option-two' ), ); add_filter('allowed_options', function($allowed_options) use ($sections) { foreach($sections as $section => $fields) { foreach($fields as $field) { $allowed_options[$section][] = $field; } } return $allowed_options; });