I am trying to get the label for a value of a List (integer) field using entity_load().

With the code I am using, I'm able to get the field key with $flagging->field_form_status['und'][0]['value'], but I need to get the label for the key|label pair. How can I achieve this?

  $flaggings = flag_get_user_flags('node', $nid);
  if (isset($flaggings['custom_flag'])) {
    $flagging = entity_load('flagging', $flaggings['custom_flag']->flagging_id);
    print "<pre>";
    print "</pre>";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.