Warning: This hook has been deprecated. Use ‘allowed_options’ instead.
whitelist_options WordPress Hook
The whitelist_options hook is a great way to ensure that only certain options are saved to the database. This can be useful if you want to limit the options that are available to your users, or if you want to make sure that only options that are valid are saved. This hook takes two arguments: an array of options that are allowed to be saved, and a callback function that will be called if an invalid option is saved.
apply_filters_deprecated( 'whitelist_options', array $allowed_options ) #
Filters the allowed options list.
Contents
Parameters
- $allowed_options
(array)The allowed options list.
Source
File: wp-admin/options.php
Changelog
Version | Description |
---|---|
5.5.0 | Use 'allowed_options' instead. |
2.7.0 | Introduced. |