W3cubDocs

/WordPress

wp_protect_special_option( string $option )

Protect WordPress special option from being modified.

Description

Will die if $option is in protected list. Protected options are ‘alloptions’ and ‘notoptions’ options.

Parameters

$option

(string) (Required) Option name.

Source

File: wp-includes/option.php

function wp_protect_special_option( $option ) {
	if ( 'alloptions' === $option || 'notoptions' === $option ) {
		wp_die( sprintf( __( '%s is a protected WP option and may not be modified' ), esc_html( $option ) ) );
	}
}

Changelog

Version Description
2.2.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_protect_special_option