Home Forums Feature Requests Image Preview for field type "file"


Image Preview for field type "file"

    • dennis

    • June 4, 2021 at 4:32 pm

    Hi, just wondering, that the preview image of a field type “file” is always just a filetype icon.

    maybe you can change current line 119 (ACF Pro 5.9.6) of “includes/fields/class-acf-field-file.php”. The variable $attachment already returns, whether it is an image file type or not. So there is no need, just to show an icon. It would be more helpful to show the image itself instead.

    line 119:

    $o['icon'] = $attachment['icon'];

    suggest to change it to:

    if($attachment['type'] == 'image') {
         $o['icon'] = $attachment['url'];
    } else {
         $o['icon'] = $attachment['icon'];
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.