ACF

How to Dump ACF field data

With this code, you are able to view the data returned from querying an acf field. It is used during development, in order to validate that the query works, or to understand the structure of the data.

To use it, just replace the field_key with your field key.

If the data is from an Options page replace this: $field = get_field(‘field_key’); with:

$field = get_field('field_key', 'option');
    
//dump acf field data $field = get_field('field_key', 'option'); echo '<pre>'.print_r($field, true).'</pre>';

Leave a Reply

Your email address will not be published. Required fields are marked *