• Resolved mfabbers

    (@mfabbers)


    Hello,

    I’m assessing this plugin to see whether to buy the PRO version.

    Great so far but I am trying to retrieve user meta values *AND* labels (the field labels entered in the forms editor) to generate a custom letter template, using information from the amended user profile.

    I can get individual meta values via get_user_meta(current_user_id, ‘meta_key’, true) but I don’t know where to retrieve the associated field label from. I think the property name for this is field_title. Is there a form object I can access? Any help available?

    Thanks,
    Marc

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sourov Amin

    (@sourov)

    Hi,

    You can use something like the below to retrieve the title from a shared field:

    global $userMeta;
    $fields = $userMeta->getData('fields');
    $fields[field_id]['field_title'];

    To retrieve the title of a non-shared field:

    global $userMeta;
    $forms = $userMeta->getData('forms');
    $forms['form_name']['fields'][field_id]['field_title'];

    Also, you can iterate through $forms or $fields array to fetch different entities.

    Thanks!

    Thread Starter mfabbers

    (@mfabbers)

    Many thanks, that is very helpful!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can I programmatically access the field labels?’ is closed to new replies.