Correct usage of ap_response_message filter
Hi,
I’m looking into modifying the anspress response messages, and can see that there is a filter ap_response_message that can be used to do exactly this.
I’ve tried using this, but the filter I apply is causing the message to stop showing entirely. I can see the filter is correctly updating the array though, so I’d like to ask if there is something I’m missing?
Here is the code I”m currently using…
function new_response($msg) { $msg[no_permission][message] = 'No!'; } add_filter('ap_responce_message', 'new_response', 1, 1);
Any help you can provide will be really appreciated!
Thanks
Matt
Hello Matt,
You forgot to return $msg.
function new_response($msg) { $msg[no_permission][message] = 'No!'; return $msg; }
matthewduhig commented on answer
Hi Rahul,
Can’t quite believe I missed that. Thanks for your help!!
Matt