wp_protect_special_option

Protect WordPress special option from being modified.

Description

wp_protect_special_option( (string) $option ); 

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

Parameters (1)

0. $option (string)
Option name.

Usage

  1. if ( !function_exists( 'wp_protect_special_option' ) ) { 
  2. require_once ABSPATH . WPINC . '/option.php'; 
  3.  
  4. // Option name. 
  5. $option = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_protect_special_option($option); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/option.php  
  1. function wp_protect_special_option( $option ) { 
  2. if ( 'alloptions' === $option || 'notoptions' === $option ) 
  3. wp_die( sprintf( __( '%s is a protected WP option and may not be modified' ), esc_html( $option ) ) );