acf_extract_vars()ACF 5.0.0

This function will remove the vars from the array, and return the vars

No Hooks.

Returns

Array. An array of extracted values.

Usage

acf_extract_vars( $extract_array, $keys );
$extract_array(array) (required) (passed by reference — &)
an array passed as reference to be extracted.
$keys(array) (required)
An array of keys to extract from the original array.

Changelog

Since 5.0.0 Introduced.

acf_extract_vars() code ACF 6.8.8

function acf_extract_vars( &$extract_array, $keys ) {
	$r = array();

	foreach ( $keys as $key ) {
		$r[ $key ] = acf_extract_var( $extract_array, $key );
	}

	return $r;
}