Support

Account

Home Forums Feature Requests Customize the "add to gallery" button label

Solved

Customize the "add to gallery" button label

  • When a gallery field shows up in the edit post screen, there is the button “add to gallery” to let a user select images from the wordpress media frame.
    Would be very useful to have the ability to change the “add to gallery” button label.

    Often a user need to have a gallery field but not necessary because he is creating a gallery in frontend. Sometimes you can create a slider, for example with only 4 images, or you can do something else.

    In these case a wrong button label could confuse a user (usually the client): for example, the field show the title “Build your slider (select up to 4 images)” but the button that open the wp media frame has the label “Add to Gallery”, and not “Add to slider”.

    Please could you take this in consideration.
    It would be an important feature.
    Thank you very much in advance.

  • Hi @virgodesign

    Thanks for the feature request and the awesome description.

    The info has been passed on to Elliot and this feature should see its way into the plugin sometime soon.

  • Hi James,
    hope to see this feature in the next acf version.
    Are there any chances?

  • Hi @virgodesign

    Thanks for the feature request.
    I’ll add this to my list, but not sure when it would be added in.

    For now, please use some jQuery to modify the text like so:

    
    <?php 
    	
    add_action('acf/input/admin_footer', 'my_acf_admin_footer');
    
    function my_acf_admin_footer() {
    	
    	?>
    	<script type="text/javascript">
    	(function($) {
    		
    		$('.acf-field-54ae017167b45 a.add-attachment').text('Build your slider (select up to 4 images)');
    		
    	})(jQuery);	
    	</script>
    	<?php
    	
    }
    
    ?>
    
  • Ok, thank you very much for the suggestion!

  • Another +1.

    More than 2 years have passed since the original request. I would love to have this option in the next version of ACF. Thanks!

  • @elliot Please consider adding this as it is now more important than ever with the ability to create blocks. “Add to Gallery” is just too confusing for some clients when a given custom block is called something else (eg. Slider).

  • When selecting multiple files, we’ve used the gallery field, instead of a file repeater, as this allows for selecting multiple files at once, and gives a nice grouped view of the selected files. Please change the button text to “Add”, or something like that.
    Perhaps you guys could create a new “Files” field with the same admin look as Gallery?

  • Seems like such an easy and arbitrary feature to add. I’ve had many, many, many instances where the word “Gallery” is actually misleading for what content goes in there. I’ve used jQuery to hack up the text onLoad for the sites that are strictly client managed, but that seems like such a long extra step and really unsustainable.

    Also, it’d be cool to add this feature to Flexible Content as well as not everything should be phrased as a “layout.”

    You’ve had it in your Repeater add-on for years and years. Can’t be that much of a leap to take that logic and apply it to the other field types.

  • Adding another vote for please making the button text customizable without a jQuery hack. Thanks!

  • Just chiming in here that if you want to tie your code to a field name instead of the ID (which would change if you created the field again elsewhere), you could change the selector in the example above to something like this:

    
    function my_acf_ungallery_button() {
    	?>
    <!-- Re-label ACF gallery button -->
    <script>
    (function($) {
    	window.addEventListener('DOMContentLoaded', function(){
    		$('.acf-field-gallery[data-name="your_field_name_here"] a.acf-gallery-add').text('Add to folder');
    	});
    })(jQuery);
    </script>
    <!-- / Re-label ACF gallery button -->
    	<?php
    }
    add_action('acf/input/admin_footer', 'my_acf_ungallery_button');
    
  • All these years later and this is STILL an issue?
    Why have a field in the admin for “Button Text”, but yet it STILL says “Add to gallery”?

  • Same issue with images and I suppose with files too.
    A parameter or at least a filter that allows to change the button label would really be great.

Viewing 14 posts - 1 through 14 (of 14 total)

The topic ‘Customize the "add to gallery" button label’ is closed to new replies.