wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_set_option_autoload › WordPress Function

Since6.4.0
已弃用n/a
wp_set_option_autoload ( $option, $autoload )
参数: (2)
  • (string) $option Name of the option. Expected to not be SQL-escaped.
    Required: Yes
  • (string|bool) $autoload Autoload value to control whether to load the option when WordPress starts up. Accepts 'yes'|true to enable or 'no'|false to disable.
    Required: Yes
查看:
返回:
  • (bool) True if the autoload value was modified, false otherwise.
定义在:
文档:

Sets the autoload value for an option in the database.

This is a wrapper for {@see}, which can be used to set the autoload value for multiple options at once.


源码

function wp_set_option_autoload( $option, $autoload ) {
	$result = wp_set_option_autoload_values( array( $option => $autoload ) );
	if ( isset( $result[ $option ] ) ) {
		return $result[ $option ];
	}
	return false;
}