wp_protect_special_option()
Protects WordPress special option from being modified.
Will die if $option is in protected list. Protected options are 'alloptions' and 'notoptions' options.
No Hooks.
Return
null
. Nothing (null).
Usage
wp_protect_special_option( $option );
- $option(string) (required)
- Option name.
Changelog
Since 2.2.0 | Introduced. |
wp_protect_special_option() wp protect special option code WP 6.7.1
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 ) ) ); } }