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');
}
});
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.