get_options

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

WordPress Version: 6.5

/**
 * Retrieves multiple options.
 *
 * Options are loaded as necessary first in order to use a single database query at most.
 *
 * @since 6.4.0
 *
 * @param string[] $options An array of option names to retrieve.
 * @return array An array of key-value pairs for the requested options.
 */
function get_options($options)
{
    wp_prime_option_caches($options);
    $result = array();
    foreach ($options as $option) {
        $result[$option] = get_option($option);
    }
    return $result;
}

WordPress Version: 6.4

/**
 * Retrieves multiple options.
 *
 * Options are loaded as necessary first in order to use a single database query at most.
 *
 * @since 6.4.0
 *
 * @param array $options An array of option names to retrieve.
 * @return array An array of key-value pairs for the requested options.
 */
function get_options($options)
{
    wp_prime_option_caches($options);
    $result = array();
    foreach ($options as $option) {
        $result[$option] = get_option($option);
    }
    return $result;
}