Support

Account

Home Forums Add-ons Gallery Field Display Field Label For Gallery Add-on Reply To: Display Field Label For Gallery Add-on

  • Hi @makeitminnesota,

    Thank you for the question.

    You can make use of the get_field_obejct function to return an array of the field object as seen in the field group edit screen.

    In your scenario, you can apply the function as follow:

    /*
    *  Get a field object and display it with it's value (using the field key and the value fron another post)
    */
    
    $field_key = "field_5039a99716d1d";
    $post_id = 123;
    $field = get_field_object($field_key, $post_id);
    
    echo $field['label'] . ': ' . $field['value'];

    You can have a look at this resource page for more info on this.