Skip to:
Content
Pages
Categories
Search
Top
Bottom

send buddypress message by PHP code


  • itsabhist
    Participant

    @itsabhist

    i want to send buddypress message by PHP code for that i made function as given below

    function send_message(){
    
    messages_new_message(
      array(
        'sender_id'  => 10,
        'thread_id' => 0,
        'recipients' => 11 ,
        'subject'    => 'NOTICE',
        'content'    => 'HELLO',
      )
    );
    } 

    but this is not working and showing error

    Notice: Undefined property: BP_Messages_Component::$table_name_messages in /home/u992033758/domains/site.com/public_html/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-message.php on line 143
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1]
    SELECT MAX(thread_id) FROM
    
    Notice: Undefined property: BP_Messages_Component::$table_name_messages in /home/u992033758/domains/site.com/public_html/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-message.php on line 148
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '( thread_id, sender_id, subject, message, date_sent ) VALUES ( 1, 10, 'NOTICE...' at line 1]
    INSERT INTO ( thread_id, sender_id, subject, message, date_sent ) VALUES ( 1, 10, 'NOTICE', 'HELLO', '2022-06-13 10:13:46' )

    please support

  • You must be logged in to reply to this topic.
Skip to toolbar