Warning: This function has been deprecated. Use add_allowed_options() instead. Please consider writing more inclusive code.

add_option_whitelist() WordPress Function

The add_option_whitelist() function is used to add a new whitelisted option to the list of options that are safe to update via the Settings API. This is useful for plugins that want to add their own settings pages and allow users to update them without having to worry about accidentally overriding any of WordPress's built-in settings.

add_option_whitelist( array $new_options, string|array $options = '' ) #

Adds an array of options to the list of allowed options.


Parameters

$new_options

(array)(Required)

$options

(string|array)(Optional)

Default value: ''


Top ↑

Return

(array)


Top ↑

Source

File: wp-includes/deprecated.php

function add_option_whitelist( $new_options, $options = '' ) {
	_deprecated_function( __FUNCTION__, '5.5.0', 'add_allowed_options()' );

	return add_allowed_options( $new_options, $options );
}


Top ↑

Changelog

Changelog
VersionDescription
5.5.0Use add_allowed_options() instead. Please consider writing more inclusive code.
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.

Show More