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.


Parameters

$allowed_options

(array)The allowed options list.


Top ↑

Source

File: wp-admin/options.php

View on Trac


Top ↑

Changelog

Changelog
VersionDescription
5.5.0Use 'allowed_options' instead.
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.