Support

Account

Home Forums General Issues image upload button disappears after the image gets deleted from media library Reply To: image upload button disappears after the image gets deleted from media library

  • I was hesitant to post this because it’s very hacky and definitely does not substitute for a proper solution in the core of ACF, but it *works for me*. I make no guarantees for you, as it may completely blow up your site and ruin your life forever. You’ve been warned.

    Also, this javascript is only loaded on edit pages in the admin section with wp_enqueue_script().

    $('.acf-field-image .acf-image-uploader .show-if-value img').each(function(){
        var $el = $(this);
        var src = $el.attr('src');
        if ( src === '' || !src ) {
            $el.height('10px');
            $el.width('10px');
        }
    });