Change "Apply Filter" text
-
Hi Jonathan,
How can I change the button label text that currently says “Apply Filter”?
-
Hi Sue,
There’s currently no way of altering it. Unless you have a different language and add a translation of your own.
I’ll look into making it translatable via filters in the next release 🙂
Thank you Jonathan.
Client said it was not urgent, so I will wait until it is available.Hi Sue,
It just occurred to me while having some eggnog that you can alter this value by using the beautiful_filters_dropdown_categories filter. You can find more about it here: https://wordpress.org/plugins/beautiful-taxonomy-filters/other_notes/
Just use the $taxonomy variable to determine which taxonomy it is and change the “show_option_all” value of the argument array.
$args['show_option_all'] = 'yourstring';Hi Jonathan,
I must be doing something wrong.
I added the following code to functions.phpfunction modify_categories_dropdown($args,$taxonomy ){ return $args['show_option_all'] = 'My Modified Text'; } add_filter('beautiful_filters_dropdown_categories','modify_categories_dropdown',10,2);The result was 2 empty dropdowns with the word Uncategorized inside.
Thanks!
Hi Sue,
You’ll have to return the entire $args variable. Not just the change you make. 🙂
function modify_categories_dropdown($args,$taxonomy ){ $args['show_option_all'] = 'My Modified Text'; return $args; } add_filter('beautiful_filters_dropdown_categories','modify_categories_dropdown',10,2);Also please note that you have to use the “all option” rather than “placeholder” for this to work. I’ll add support for placeholder in a future release 🙂
Thanks!
It worked!Is there any reason why I shouldn’t use this function? (if I don’t have anything else on my site that needs to say ‘Apply Filters’ of course!):
add_filter('gettext', 'translate_text'); add_filter('ngettext', 'translate_text'); function translate_text($translated) { $translated = str_ireplace('apply filter', 'Search', $translated); return $translated; }Outofhouse you should really create your own support thread for a new question.
But I’ll answer you here this time. No there’s no reason why you couldn’t use that function. Like you say, as long as there’s only one “apply filter” string its fine. However it might not be the best solution performance-wise. I’ve not read up on the filter so I cant say 🙂
Sorry – I thought this was a possible solution to exactly what the original post was about and might be helpful to others searching for the same thing! However, I will create a new post for any new question from now on…
Hi,
Just want to let you know that there is now a dedicated filter for changing the buttons text.
So you can replace your gettext filter with that 🙂
*beautiful_filters_apply_button*You can find it if you scroll down a bit here: https://wordpress.org/plugins/beautiful-taxonomy-filters/other_notes/
Thanks Jonathan!
Again, I must be missing something here.
It is not changing the “Apply Filter” text.function modify_filter_button($string){ return 'Submit Search'; } add_filter('beautiful_filters_apply_button', 'modify_filter_button', 10, 1);Hm.. try updating to the latest hotfix.
I’ve tried it myself and it works on my devsite with v1.1.4.1.I assume you place the code in your themes functions.php 🙂
Hi Jon,
I have updated to the latest hotfix #3 (1.1.4.2).
Yes, the code is inside the theme’s functions.phpIt is just under the other code that works (modify_categories_dropdown).
Cleared cache and still shows “Apply Filter” Instead of “Submit Search”
Thanks
It works in every way I try it on my sites..
To help you further I’d have to have access to your FTP 🙂
Hi Jonathan,
Where do I send you the FTP info?
Thanks
The topic ‘Change "Apply Filter" text’ is closed to new replies.