wp_protect_special_option

函数


wp_protect_special_option ( $option )
参数
  • (string)
    $option
    Option name.
    Required:
定义位置
  • wp-includes/option.php
    , line 266
引入
2.2.0
弃用

Protects WordPress special option from being modified.

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

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 )
			)
		);
	}
}