Skip to:
Content
Pages
Categories
Search
Top
Bottom

Header Errors When Trying to Send PM

  • @crashutah

    Participant

    I’m trying to do the following BP command in one of my plugins:
    `messages_new_message( array( ‘recipients’ => $recipients, ‘subject’ => $subject, ‘content’ => $message ) );`

    The PM message seems to send fine and the email gets sent, but it’s giving me the following errors:
    Warning: Cannot modify header information – headers already sent by (output started at /public_html/wp-admin/admin-header.php:19) in /public_html/wp-content/plugins/buddypress/bp-messages.php on line 549

    Warning: Cannot modify header information – headers already sent by (output started at /public_html/wp-admin/admin-header.php:19) in /public_html/wp-content/plugins/buddypress/bp-messages.php on line 550

    Warning: Cannot modify header information – headers already sent by (output started at /public_html/wp-admin/admin-header.php:19) in /public_html/wp-content/plugins/buddypress/bp-messages.php on line 551

    Anyone have any ideas on what could be causing these errors? Am I using messages_new_message() incorrectly?

Viewing 3 replies - 1 through 3 (of 3 total)
  • @crashutah

    Participant

    Looks like other places talk about white space in front of or after the PHP tags. Any other things that can cause this error?

    @djpaul

    Keymaster

    No, this message is always caused by some data being returned before a header() call.

    @crashutah

    Participant

    @djpaul Could you describe a little more what makes it happen?

    In the case above, I’m calling messages_new_message() on an admin page when it loads based upon the variables that are being passed into that page. I don’t actually call messages_new_message() until the page is about half loaded. Is messages_new_message() returning some data before the header() call? What’s the solution to get around this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Header Errors When Trying to Send PM’ is closed to new replies.
Skip to toolbar