Home › Forums › Backend Issues (wp-admin) › How to change “Add to Gallery” button text? › Reply To: How to change “Add to Gallery” button text?
With the help of ACF support and a friend, we came up with how to do this in functions.php
// Change ACF Gallery Button Text
function my_acf_input_admin_footer()
{
?>
<script type="text/javascript">
jQuery(document).ready(function(){
acf.add_action('load', function( $el ){
jQuery(".acf-block-body .acf-button.acf-gallery-add").each(function(index) {
this.innerText = "Add Images";
});
});
acf.add_action('append', function( $el ){
jQuery(".acf-block-body .acf-button.acf-gallery-add").each(function(index) {
this.innerText = "Add Images";
});
});
});
</script>
<?php
}
add_action('acf/input/admin_footer', 'my_acf_input_admin_footer');
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.