Support

Account

Home Forums Feature Requests Show php template output of fields

Solved

Show php template output of fields

  • It would be great if we can see a section on the field group area that shows sample php outputs of fields so we can just copy and paste into our template files.

    Example of section can show:

    $label-of-field = get_field( ‘name-of-field’ );
    $label-of-field2 = get_field( ‘name-of-field2’ );

  • The main problem with trying to do this is that there a lot of different ways to use fields. get_field() is only one of the functions available and that does not help you with what is actually returned. What if the field is a repeater sub field. What would be shown if that sub field is an image field.

    Also, unlike some other custom field plugins, there are only a few functions in ACF that will be used most of the time and the parameters for these functions are the same across all field types. I think that Elliot has done a great job at keeping the template code that need to be written to get fields extremely simple.

  • Problem Solved!
    Addon to show all field variables of you field groups!
    https://github.com/samjco/ACF-PHP-VARS

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

The topic ‘Show php template output of fields’ is closed to new replies.