Home Forums General Issues Get field label from field id


Get field label from field id

  • Hello guys,

    After digging around I saw that ACF save the fields of a group as child posts which has post_name (in this case is label) is field ID.

    I can get the post_title (label of field) by post_name (field_id), but is there any better way to get it?.

    What I want is I can apply a filter to array of field_ID, then return the field_label, instead of field_ID as usual.

    Thank you

  • Hi @andrew-tr ,

    Thanks a lot for reaching out.

    A better approach would be to use the API’s methods such as get_field_object and get_field_objects which will return the field as an object.

    From here you can access the various field attributes label included.

    I hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Get field label from field id’ is closed to new replies.