wpseek.com
A WordPress-centric search engine for devs and theme authors



get_options › WordPress Function

Since6.4.0
Deprecatedn/a
get_options ( $options )
Parameters:
  • (string[]) $options An array of option names to retrieve.
    Required: Yes
Returns:
  • (array) An array of key-value pairs for the requested options.
Defined at:
Codex:

Retrieves multiple options.

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


Source

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

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

	return $result;
}