Reputation: 978
i'm using the woocommerce product Add-ons plugin and i want to change the default value that appears on dropdowns that says 'select an option':
I managed to find all other english texts in the plugins editor and changed them but this single line is bugging me because i can't seem to find where it is initialized.
EDIT
This is the exact plugin i'm using:
Any help would be much appreciated!
Upvotes: 2
Views: 4170
Reputation: 1
Use this code and place it into functions.php
add_filter( 'gettext', 'customizing_product_variation_message', 10, 3 );
function customizing_product_variation_message( $translated_text, $untranslated_text, $domain )
{
if ($untranslated_text == 'Select an option...') {
$translated_text = __( 'PAST YOUR TEXT HERE', $domain );
}
if ($untranslated_text == 'None') {
$translated_text = __( 'PAST YOUR TEXT HERE', $domain );
}
return $translated_text;
}
Upvotes: 0
Reputation: 447
The quickest way would be to add a line on your functions.php child theme where you can change text:
add_filter( 'gettext', 'customizing_product_variation_message', 10, 3 );
function customizing_product_variation_message( $translated_text, $untranslated_text, $domain )
{
if ($untranslated_text == 'Select an option...') {
$translated_text = __( 'ENTER HERE THE NEW TEXT', $domain );
}
return $translated_text;
}
Bear in mind that you might need to remove the ... at the end of the "Select an option" text.
Hope that helps
Upvotes: 2