Select::get_options()
Description #
Return options of a select field.
Source #
File: lib/form/class-select.php
private function get_options() {
$options = $this->get( 'options' );
if ( is_string( $options ) && 'terms' === $options ) {
return get_terms( $this->get( 'terms_args', array() ) );
}
if ( is_string( $options ) && 'posts' === $options ) {
return wp_list_pluck( get_posts( $this->get( 'posts_args', array() ) ), 'post_title', 'ID' );
}
return (array) $options;
}
Expand full source code Collapse full source code View on GitHub: lib/form/class-select.php:68
Add your comment