wp_protect_special_option( string $option )

In this article

Protects WordPress special option from being modified.

Description

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

Parameters

$optionstringrequired
Option name.

Source

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

Changelog

VersionDescription
2.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.