Good afternoon, can anyone tell me how I can change the text of the error message “Cheatin’ uh?” when a non-administrator user tries to access a banned section by mistake?
I don’t want to remove the error message and am not looking for a way to fix it.
It seems unprofessional to me for a client to receive a “Cheatin’ uh?” message.
So I would just like to know how I can change the text of the error message (and possibly its translation).
You can use the str_replace.
Just put this in your functions file:
function replace_text($text) {
$text = str_replace('Cheatin’ uh?', 'You do not have access to this page', $text);
return $text;
}
add_filter('the_content', 'replace_text');
You mauy have to escpape the apostrophe in Cheatin’, like this:
Cheat\’in
Hopefully the function will kick off before the message displays. You would have to test it.
Viewing 1 replies (of 1 total)
The topic ‘Change Error Message Text’ is closed to new replies.