Sending private message programatically failing in AJAX call
I’m implementing a custom AJAX handler which calls messages_new_message() to send a private message on behalf of a user.
This sort of works, in that the message is getting sent, and email notification triggered etc. However, none of my code in the callback placed after the messages_new_message call gets executed.
I tried to pin it down and it seems like something’s going wrong at the do_action line right before messages_new_message’s return:
do_action_ref_array( 'messages_message_sent', array( &$message ) );
If I insert an error_log call above that line, it gets executed. If I insert one after, it doesn’t.
I had a look at each of the actions added to that hook in the BuddyPress source and couldn’t find anything triggering a redirect or calling wp_die() or anything, and I checked that no other plugins I have installed are hooking onto that.
I’m a bit stumped. Is there some reason that calling messages_new_message() from an AJAX handler would fail, or some way I can debug this further?
Thanks in advance for any help!
- You must be logged in to reply to this topic.