Home › Forums › General Issues › How to change the Filter text "select taxonomy" to "Select city"?
How to change the text “select taxonomy” to “Select city”?
I have created a Custom field group
1.Leader
2.Program
and I have created Select leader option in a program page by city.
I have used the filter “filter by taxonomy”.
Please see the screenshot. Filter By taxonomy show dropdown.
How to change the text “select taxonomy” to “Select city”?
That field is used when you allow editors to select posts from multiple taxonomies, for example if you want to allow them to select from “Tags” or “Categories” on a post.
If they can only select from “Cities” then you need to remove the “Taxonomy” from the filters setting of your post object (relationship) field.
Although I don’t understand how the image you posted showing authors relates to “Cities”.
Hi, Did you ever figure this out. I think I want the same thing.
I have two taxonomies I want them to choose from which but i want to change the wording of the option “select taxonomy” because on a front end form people don’t understand what taxonomy.
I have tried a couple of things
add_filter(‘the_content’, ‘s4f_acf_prepare_taxonomy’); with the function replacing the text but it did not work.
I think it might have to do with a filter similar to this
add_filter('acf/prepare_field/name=_post_title', 's4f_acf_prepare_title');
function s4f_acf_prepare_title( $field ) {
$field['label'] = "Goal Name";
if ( $field ) {
return $field;
} else {
exit;
}
I will be back to this and will post if I find a solution
I found how to do this with jquery
jQuery(document).ready(function($) {
var strNewString = $('#FIELDID').html().replace(/\Select taxonomy/g,'NEW TEXT');
$('#FIELDID').html(strNewString);
});
Replace the #FIELDID with the field id this is in #acf-field_#####
Replace the NEW TEXT with the text you want to show
I have a custom scrip page but you could add it inside script tags on the page that is loading the form.
I hope this helps someone as I was searching all the wrong places for this.
Add a wrapper id
for me its sc_city
then add this jquery
$($("#sc_city option")[0]).text('Select city');
I updated all instances of “select taxonomy” to “Filter Results” instead using the below jquery (add this to your functions.php):
function my_acf_input_admin_footer() {
?>
<script type="text/javascript">
(function($) {
jQuery(document).ready(function($) {
var strNewString = $('.acf-relationship').html().replace(/\Select taxonomy/g,'Filter Results');
$('.acf-relationship').html(strNewString);
});
})(jQuery);
</script>
<?php
}
add_action('acf/input/admin_footer', 'my_acf_input_admin_footer');
Yes you are right ?>
<script type=”text/javascript”>
(function($) {
jQuery(document).ready(function($) {
var strNewString = $(‘.acf-relationship’).html().replace(/\Select taxonomy/g,’Filter Results’);
$(‘.acf-relationship’).html(strNewString);
});
})(jQuery);
</script>
<?php
}
I was founding the solution about (to change the Filter text “select taxonomy” to “Select city”) after reaching this page, Query solved! and I get more knowledge about it here’s my site https://animenexty.com/ You can also check it by clicking on that link. My site is working properly.
function my_acf_input_admin_footer() {
?>
<script type=”text/javascript”>
(function($) {
jQuery(document).ready(function($) {
var strNewString = $(‘.acf-relationship’).html().replace(/\Select taxonomy/g,’Filter Results’);
$(‘.acf-relationship’).html(strNewString);
});
})(jQuery);
</script>
<?php
}
add_action(‘acf/input/admin_footer’, ‘my_acf_input_admin_footer’);
The topic ‘How to change the Filter text "select taxonomy" to "Select city"?’ is closed to new replies.
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.