Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Which function should I call to send private message?


Mack
Participant

@nebril

The function I wrote is as following –
function send_msg($user_id, $title, $message){
$args = “recipients=$user_id&sender_id’=11&subject’=$title&content’=$message”;

messages_new_message( $args );
}

I pass only recipients id, sender id, subject and content, due to call to wp_parse_args in messages_new_message, which fills message parameters which aren’t sent with default values, I believe. But it doesn’t affect database at all, no new messages are inserted.

About inbox, the installation I am working on is quite tweaked, so I don’t know what has been enabled and what disabled :P. But if pm’s are disabled, is there an easy way to enable them? Also if pm’s are disabled, will message_new_message function do anything at all?

Cheers
Maciej

Skip to toolbar