The forums are closed and will be removed when we launch our new site.
Looking for support? You can access the support system via your account.
Brookstone Creative
Forum Replies Created
-
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 24, 2019 at 3:28 pm #214761Thanks for you help on this 🙂
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 24, 2019 at 3:27 pm #214759Hello to update this I have now got the the code working correctly. Here shows 2 text replacement one after the other.
function my_plugin_search_filter_change_label($input_object, $sfid) { if ($sfid == 845 && $input_object['name'] == '_sft_category') { foreach ($input_object['options'] as $key => $option) { if ($option->label == 'All Categories') { $input_object['options'][$key]->label = 'Toutes Catégories'; } } foreach ($input_object['options'] as $key => $option) { if ($option->label == 'Accessories and Cables') { $input_object['options'][$key]->label = 'Accessoires et Câbles'; } } } return $input_object; } add_filter('sf_input_object_pre', 'my_plugin_search_filter_change_label', 10, 2);
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 20, 2019 at 9:12 am #214554Ignore my last message I believe it was because I changed the _sft_file_type[] to _sft_file_type.
I have also worked out how add multiple text. I have tried the same code trying to replace the text on the dropdown menus. I cant seem to get these to work can you help me with those aswell.
Thanks
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 20, 2019 at 9:03 am #214552Hello Yes they both appeared but when I refreshed my browser Brochures got replaced with Test so I removed your echo code I added and it was still there so it must have been some kind of caching issue.
At least I know now the codes works in the correct place. May I ask how I can add multiple text replacements in this?
Thanks
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 19, 2019 at 5:07 pm #214510Thankyou
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 19, 2019 at 3:26 pm #214482I have tried it in the functions.php but I cant seem to get it to change word ‘Brochures’ to ‘Test’
This is the code I have used am I missing something?
<?php function my_plugin_search_filter_change_label($input_object, $sfid) { if ($sfid == 845 && $input_object['name'] == '_sft_file_type[]') { foreach ($input_object['options'] as $key => $option) { if ($option->label == 'Brochures') { $input_object['options'][$key]->label = 'Test'; } } } return $input_object; } add_filter('sf_input_object_pre', 'my_plugin_search_filter_change_label', 10, 2); ?>
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 19, 2019 at 12:56 pm #214467Okay thanks where would I put this code, could I use it in the archive-downloads_french.php post type theme or does it go somewhere else?
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 19, 2019 at 12:33 pm #214457I have found this however it as sfid ==12345 what do you use to replace 12345? Would this be a more correct snippet.
function my_plugin_search_filter_change_label($input_object, $sfid) { if ($sfid == 12345 && $input_object['name'] == '_sf_post_type') { foreach ($input_object['options'] as $key => $option) { if ($option->label == 'Media') { $input_object['options'][$key]->label = 'Photos'; } } } return $input_object; } add_filter('sf_input_object_pre', 'my_plugin_search_filter_change_label', 10, 2);
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 19, 2019 at 12:28 pm #214455Hello is there a particular post that cant help me with this. I am looking at all the php and I have not an idea which I need to get it to swap out text in the labels of the filter.
Brookstone Creative in reply to:
using string to translate text in within filter(Private) June 19, 2019 at 11:54 am #214451Hello from there snippets what is co authors plus? what would I replace this with in my case.
Thanks
-
AuthorPosts