I have added a custom field with title 'play time'. How can I get the field name(internal value) using label value in my custom module. Is there any function to get the value?

  • 1
    No you'll need to query the field info tables manually for that
    – Clive
    Feb 14 '15 at 10:33

If you want to find specific content types based on field you can use:

field_info_instances($entity_type, $bundle_name);

If you want to find any field you can use:


In both cases you will get an array of fields and you can get field name by filtering label value.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.