When I register on My account page, I receive a message says:
"Registration successful! You will be notified upon approval of your account."
How do I change this text?
I have searched around, and I was surprised that no one is searching for this.
Update:
As it's a Wordpress notice, and it's generated most of the time with sprintf() function (partial text + variables), you can check if you get partially an extract of this sentence using
stripos()
php function in the condition, this way:
add_filter( 'gettext', 'customizing_specific_text_in_woocommerce', 10, 2 );
function customizing_specific_text_in_woocommerce( $customized_text, $targeted_text, $domain )
{
// Set Here an extract of the text to replace:
$text_to_find = 'be notified upon approval of your account';
if ( stripos( strtolower( $targeted_text ), '$text_to_find' ) !== false && is_account_page() ) {
// Set here your replacement text.
$customized_text = __('My custom text goes here.', $domain);
}
return $customized_text;
}
You will have to make different tries, to get it work...
This text is certainly part of your main theme customizations, that's why you haven't find any related problem on internet. You should try to use the WordPress gettext
filter hook function, this way (without any guaranty, as I can't test it really):
add_filter( 'gettext', 'customizing_specific_text_in_woocommerce', 10, 2 );
function customizing_specific_text_in_woocommerce( $customized_text, $targeted_text, $domain )
{
// Set Here the text to replace:
$text_to_find = 'Registration successful! You will be notified upon approval of your account.';
if ( $text_to_find == $targeted_text && is_account_page() ) {
// Set here your replacement text.
$customized_text = __('My custom text goes here.', $domain);
}
return $customized_text;
}
This code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This text is certainly a theme customization, and should be located in your main active parent theme files, in the woocommerce templates folder or in some other themes files.