ACF_Location_Options_Page::get_values
Returns an array of possible values for this rule type.
Method of the class: ACF_Location_Options_Page{}
No Hooks.
Returns
Array.
Usage
$ACF_Location_Options_Page = new ACF_Location_Options_Page(); $ACF_Location_Options_Page->get_values( $rule );
- $rule(array) (required)
- A location rule.
Changelog
| Since 5.9.0 | Introduced. |
ACF_Location_Options_Page::get_values() ACF Location Options Page::get values code ACF 6.8.8
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[''] = __( 'Select options page...', 'acf' );
}
if ( acf_get_setting( 'enable_options_pages_ui' ) ) {
$choices['add_new_options_page'] = __( 'Add New Options Page', 'acf' );
}
// Return choices.
return $choices;
}