I am trying to edit the "Enter a Location" string, in the search view with a custom string > "Inserisci un indirizzo"
I use this code:
jQuery( function( $ ) {
$( "#toolset-maps-distance-center" ).attr( "placeholder", 'Inserisci un indirizzo...');
});
It changes the string and it works,
but rightly, when the user enter the address and the page is reloaded it deletes the address and replace it with the "Inserisci un indirizzo" string again.
I would a solution about it changes it just if no address is inserted.
- I also have problems with the icon in the "Use my location" button
I use:
- Elementor
- Ajax view
- I tried to find the "Enter a Location" string with Loco Translate to replace it but with no success
Hello,
You can translate the text "Enter a location" with WordPress built-in filter hook gettext, for example, add below codes into your theme file "functions.php":
add_filter('gettext', 'my_func3', 10, 3);
function my_func3($translated_text, $text, $domain){
if($text == 'Enter a location' && $domain == 'toolset-maps'){
$translated_text = ' Inserisci un indirizzo...'; // here you can change the text.
}
return $translated_text;
}
More help:
https://developer.wordpress.org/reference/hooks/gettext/
Ok Luo it works!
but i always have problems i try to style the form.
If i remove the distance unit and value via css it doesn't record che inserted address
i use this css:
select.js-toolset-maps-distance-unit{
display:none;
}
.js-toolset-maps-distance-value {
display: none !important;
}
I also have problems with the icon of the current location button, it shows this char
I assume the original question of this thread is resolved, for the new questions, please check the new thread here:
https://toolset.com/forums/topic/i-have-problems-to-style-the-distance-filters/