Support

Account

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.