get_options( array $options ): array

Retrieves multiple options.


Description

Options are loaded as necessary first in order to use a single database query at most.


Top ↑

Parameters

$options array Required
An array of option names to retrieve.

Top ↑

Return

array An array of key-value pairs for the requested options.


Top ↑

Source

File: wp-includes/option.php. View all references

function get_options( $options ) {
	wp_prime_option_caches( $options );

	$result = array();
	foreach ( $options as $option ) {
		$result[ $option ] = get_option( $option );
	}

	return $result;
}


Top ↑

Changelog

Changelog
Version Description
6.4.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.