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

  • 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 -->
    (function($) {
    	window.addEventListener('DOMContentLoaded', function(){
    		$('.acf-field-gallery[data-name="your_field_name_here"] a.acf-gallery-add').text('Add to folder');
    <!-- / Re-label ACF gallery button -->
    add_action('acf/input/admin_footer', 'my_acf_ungallery_button');