wp_protect_special_option

The timeline below displays how wordpress function wp_protect_special_option has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.4

/**
 * Protects WordPress special option from being modified.
 *
 * Will die if $option is in protected list. Protected options are 'alloptions'
 * and 'notoptions' options.
 *
 * @since 2.2.0
 *
 * @param string $option Option name.
 */
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)
        ));
    }
}

WordPress Version: 5.3

/**
 * Protect WordPress special option from being modified.
 *
 * Will die if $option is in protected list. Protected options are 'alloptions'
 * and 'notoptions' options.
 *
 * @since 2.2.0
 *
 * @param string $option Option name.
 */
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)
        ));
    }
}

WordPress Version: 3.9

/**
 * Protect WordPress special option from being modified.
 *
 * Will die if $option is in protected list. Protected options are 'alloptions'
 * and 'notoptions' options.
 *
 * @since 2.2.0
 *
 * @param string $option Option name.
 */
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)));
    }
}

WordPress Version: 3.7

/**
 * Protect WordPress special option from being modified.
 *
 * Will die if $option is in protected list. Protected options are 'alloptions'
 * and 'notoptions' options.
 *
 * @since 2.2.0
 * @package WordPress
 * @subpackage Option
 *
 * @param string $option Option name.
 */
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)));
    }
}