I am trying to get the taxonomy name which I already got its machine name. The content type "manage field" looks like following image: enter image description here

Right now, I already got the value "field_application_type." How can I get the lable "application type"(in the red circle) for this machine name(in the blue circle)?


The correct way to obtain a Label of a taxonomy vocabulary would be something like this:

$vocabulary = taxonomy_vocabulary_machine_name_load('machine_name');
echo check_plain($vocabulary->name);

However, looking at your screenshot, I guess you actually want to have the field Label of the taxonomy reference field.

In that case your question is a duplicate of How do I get a field label by the field name?

  • Thank you very much. You are right, my question is duplicate. The answer there works well. – jmu Jun 2 '16 at 19:59

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.