ACF File field returning integer instead of array
-
I’m using the plugin on a custom post type that uses ACF fields. For one particular field, a “File” field, the template is set up to render a file array, which it does correctly when viewing a published post. However, when viewing the same page a Post Draft Preview URL, it returns an integer (the file ID). Any suggestions?
Here’s the code in the template:
$file = get_field('pdf');
$url = $file['url'];
$title = $file['title'];echo esc_attr($url);
echo esc_html($title);
- The topic ‘ACF File field returning integer instead of array’ is closed to new replies.