Home › Forums › Feature Requests › [image field] image replacing improvement › Reply To: [image field] image replacing improvement
I had the same issue with a client who didn’t think of deleting the image in order to select a new one (or to upload a new one). I solved it by preventing ACF to hide the ‘Add new image’ button that is visible when no image is selected yet. If you have an admin.css stylesheet just add this:
.acf-image-uploader.has-value .hide-if-value {
display: block;
clear: both;
float: left;
margin: 1em 0;
}
It’s the first directive that does the trick, the rest is for some proper formatting of the button when there is an image present.
If there isn’t an admin stylesheet you just enqueue one with this rule.
The button remains visible when there is already an image, so you can use it to select a new one. It works for replacing.
I changed .po file accordingly to reflect this possibility: change ‘Add image’ to something like ‘Select image’ so it’s more generic.
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.