Support

Account

Home Forums Add-ons Gallery Field Gallery Field – Media Library Strings

Solving

Gallery Field – Media Library Strings

  • Hello,

    I’m using the Gallery Field on a frontend form. I’m looking to change the bottom right blue button labeled “Select” when on the Media Library tab. I want to change that to a different text.

    I’ve tried the media_view_strings filter hook to change the ‘select’ key, but that didn’t seem to update the text here.

    I’ve tried the gettext filter hook specifically targeting “Select” but even that didn’t seem to update the text here.

    It seems like it’s specific to Advanced Custom Fields, but I can’t seem to narrow down where exactly or how I can change it.

    How can I update this button text to something different?

  • I found a reference to the media popup here https://www.advancedcustomfields.com/resources/javascript-api/#actions-append. It may be possible to alter the value of the button on the append action. I have not tested it so I can’t say for sure.

  • Thanks for the suggestion, but I can’t seem to get this to fire at all. It’s not inside a repeater, it’s just a basic, flat frontend form. Here’s the code I was using:

     if( 'object' == typeof acf ) {
    	acf.addAction( 'append', function( $el ) {
    		console.log( $el );
    	} );
    }
  • How is your script loaded/enqueued?

  • Using the wp_enqueue_scripts hook, loaded into the footer. I’ve also tried to call the above snippet on its own in a wp_footer hook but still doesn’t seem to console out anything either on page load or when opening the Media Library to add-in files.

  • Try doing a console.log on acf before you to the if statement. Maybe it is not defined when your script is running.

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

You must be logged in to reply to this topic.