wp_set_option_autoload_values
wp_set_option_autoload_values ( $options )
Parameters:- (array) options Associative array of option names and their autoload values to set. The option names are expected to not be SQL-escaped. The autoload values should be boolean values. For backward compatibility 'yes' and 'no' are also accepted, though using these values is deprecated.
Returns:- (array) Associative array of all provided $options as keys and boolean values for whether their autoload value was updated.
Defined at:Change Log: - Introduced in WordPress: 6.4.0
- Deprecated in WordPress: —
Description
Sets the autoload values for multiple options in the database.Autoloading too many options can lead to performance problems, especially if the options are not frequently used.
This function allows modifying the autoload value for multiple options without changing the actual option value.
This is for example recommended for plugin activation and deactivation hooks, to ensure any options exclusively used
by the plugin which are generally autoloaded can be set to not autoload when the plugin is inactive.