allowed_options
Filter HookDescription
Filters the allowed options list.Hook Information
File Location |
wp-admin/options.php
View on GitHub
|
Hook Type | Filter |
Line Number | 237 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$allowed_options
|
The allowed options list. |
Usage Examples
Basic Usage
<?php
// Hook into allowed_options
add_filter('allowed_options', 'my_custom_filter', 10, 1);
function my_custom_filter($allowed_options) {
// Your custom filtering logic here
return $allowed_options;
}
Source Code Context
wp-admin/options.php:237
- How this hook is used in WordPress core
<?php
232 *
233 * @since 5.5.0
234 *
235 * @param array $allowed_options The allowed options list.
236 */
237 $allowed_options = apply_filters( 'allowed_options', $allowed_options );
238
239 if ( 'update' === $action ) { // We are saving settings sent from a settings page.
240 if ( 'options' === $option_page && ! isset( $_POST['option_page'] ) ) { // This is for back compat and will eventually be removed.
241 $unregistered = true;
242 check_admin_referer( 'update-options' );
PHP Documentation
<?php
/**
* Filters the allowed options list.
*
* @since 5.5.0
*
* @param array $allowed_options The allowed options list.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-admin/options.php
Related Hooks
Related hooks will be displayed here in future updates.