Hi, thank you for your response, and your alternative solution, I really appreciate it. However, I stand by my point that it does not work correctly.
Your example refers to your default message, not your overriding message. I get that it works on your default message, as your code suggests that it does. Look however at the order of the handling of functions in your new-user-approve.php file, around line 670.
First the default message is set, then the tags are replaced. So that means it works fine for your default message, as your test suggests. To test this issue, your test should have been done not on the default, but on the overriding filter that follows the translation function.
See your code below:
$message = nua_default_approve_user_message();
$message = nua_do_email_tags( $message, array(
'context' => 'approve_user',
'user' => $user,
'user_login' => $user_login,
'user_email' => $user_email,
) );
$message = apply_filters( 'new_user_approve_approve_user_message', $message, $user );
In the last line the overriding filter ‘new_user_approve_approve_user_message’ is applied, but AFTER the tag replacement function, so the tags do not get translated.
Simply shifting the order of the code would solve this, like I tested:
$message = nua_default_approve_user_message();
$message = apply_filters( 'new_user_approve_approve_user_message', $message, $user );
$message = nua_do_email_tags( $message, array(
'context' => 'approve_user',
'user' => $user,
'user_login' => $user_login,
'user_email' => $user_email,
) );
In this order both the default and the overriding filter tags get replaced.
I had already solved it for myself by repeating the nua_do_email_tags() function within my filter function, that worked, but it is not clean and no option for non-programmers, and it does not address the base issue.
I hope you will take a look at it again.
Thanks.
-
This reply was modified 2 years, 11 months ago by
tezalsec.
-
This reply was modified 2 years, 11 months ago by
tezalsec.
-
This reply was modified 2 years, 11 months ago by
tezalsec.
-
This reply was modified 2 years, 11 months ago by
tezalsec.