Can you get allowed values for reference field?
i tried with:
$all_fields_info = field_info_fields();
$allowed_values= list_allowed_values($all_fields_info["field_user_ref"]);
but it is not working ..
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityCan you get allowed values for reference field?
i tried with:
$all_fields_info = field_info_fields();
$allowed_values= list_allowed_values($all_fields_info["field_user_ref"]);
but it is not working ..
For an entityreference fields use:
$allowed_values = entityreference_get_selection_handler("field_user_ref")->getReferencableEntities();