wp_set_option_autoload

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

WordPress Version: 6.4

/**
 * Sets the autoload value for an option in the database.
 *
 * This is a wrapper for {@see wp_set_option_autoload_values()}, which can be used to set the autoload value for
 * multiple options at once.
 *
 * @since 6.4.0
 *
 * @see wp_set_option_autoload_values()
 *
 * @param string      $option   Name of the option. Expected to not be SQL-escaped.
 * @param 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.
 * @return bool True if the autoload value was modified, false otherwise.
 */
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;
}