ACF_Location_Page::get_values
Returns an array of possible values for this rule type.
Метод класса: ACF_Location_Page{}
Хуков нет.
Возвращает
Массив.
Использование
$ACF_Location_Page = new ACF_Location_Page(); $ACF_Location_Page->get_values( $rule );
- $rule(массив) (обязательный)
- A location rule.
Список изменений
| С версии 5.9.0 | Введена. |
Код ACF_Location_Page::get_values() ACF Location Page::get values ACF 6.4.2
public function get_values( $rule ) {
$choices = array();
// Get grouped posts.
$groups = acf_get_grouped_posts(
array(
'post_type' => array( 'page' ),
)
);
// Get first group.
$posts = reset( $groups );
// Append to choices.
if ( $posts ) {
foreach ( $posts as $post ) {
$choices[ $post->ID ] = acf_get_post_title( $post );
}
}
return $choices;
}