Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Let's say I have a field in Drupal called resource_type, and I wanted to get all allowed values. Is there any easy way to do this with a command, or do I have to do a database query? I'm not seeing anything specifically that would make this easy.
For list type field you can use list_allowed_values function , You can also use field_info_field($field_name) for more details about field.
$my_field = field_info_field('field_resource_type');
Required, but never shown