PDA

View Full Version : this should be easy - phrase replace


testbot
10-24-2009, 02:50 PM
i can't seem to get this to work in a plugin:

hook: register_activate_process

$my_msg = "something";

$vbphrase['activate_wrongusergroup'] = $my_msg;

or

$vbphrase['activate_wrongusergroup'] = $construct_phrase($my_msg);

i want to replace that phrase that already exists with something else based on a condition.

Lynne
10-26-2009, 07:05 PM
Your hook location is being done for the part of the condition that isn't evaling the error. You are using the "if" part, the error gets evaled in the "else" part. So, I don't think your change of the phrase is being seen.

(You may not be able to change that particular phrase using that method in this case. If you look at the function fetch_error (which is used for to eval the activate_wrongusergroup error phrase), the input is a phrase name which then gets evaled. I think you would have to do your condition around the fetch_error and pass it another variable depending on the output of your condition which would mean modifying the code and not using a plugin.)