Site logo

Archived topic

Elements header breaks ACF return values

15 replies · Started by Toby on August 10, 2020

Viewing posts 16–16 of 16

The {{custom_field}} template tag is set to return single values. If the custom field you're using is returning an array, it won't work.

You could try this to debug:

add_shortcode( 'embed_file', function() {
    ob_start();
    $current_post = get_queried_object();
    
    $embed_file = get_field( 'report_file', $current_post );
    var_dump($embed_file);
    $report_file_url = $embed_file['url'];

    echo $report_file_url;
    return ob_get_clean();
} );
This archived topic is closed to new replies.