Home › Forums › Add-ons › Gallery Field › 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 );
} );
}
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.
You must be logged in to reply to this topic.
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.