ACF_Location_Options_Page::get_values()publicACF 5.9.0

Returns an array of possible values for this rule type.

Метод класса: ACF_Location_Options_Page{}

Хуков нет.

Возвращает

Массив.

Использование

$ACF_Location_Options_Page = new ACF_Location_Options_Page();
$ACF_Location_Options_Page->get_values( $rule );
$rule(массив) (обязательный)
A location rule.

Список изменений

С версии 5.9.0 Введена.

Код ACF_Location_Options_Page::get_values() ACF 6.0.4

public function get_values( $rule ) {
	$choices = array();

	// Append pages.
	$pages = acf_get_options_pages();
	if ( $pages ) {
		foreach ( $pages as $page ) {
			$choices[ $page['menu_slug'] ] = $page['page_title'];
		}
	} else {
		$choices[''] = __( 'No options pages exist', 'acf' );
	}

	// Return choices.
	return $choices;
}