Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 6 years ago

#7941 closed defect (bug) (no action required)

Buddy press action hook for BP message reply

Reported by: rgipp1's profile rgipp1 Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: Priority: normal
Severity: normal Version: 3.0.0
Component: Messages Keywords:
Cc:

Description

I'm looking to take action when any BP message is replied to.
I read thru the BuddyPress Actions Hooks document and tried many of the BP action hooks with no success.

Here's an example of my code in a plugin I created (below).

I test it by replying to a message in BuddyPress.

I'm not getting the function to execute since the file isn't getting created.

function test_message_meta_display() {


$myfile = fopen("deletethreadsinfunction.txt", "w") or die("Unable to open file!");

$txt = "threadID, userID = " . $threadID . " " . $userID . "\n";
fwrite($myfile, $txt);

}

add_action( 'bp_after_message_content', 'test_message_meta_display', 10, 0 );

Change History (1)

#1 @r-a-y
6 years ago

  • Component changed from BuddyPress.org Sites to Messages
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

You reference $threadID and $userID, but you are not actually referencing the thread ID or user ID anywhere.

We have some message thread template tags here for the thread ID and sender ID:
https://buddypress.trac.wordpress.org/browser/tags/3.1.0/src/bp-messages/bp-messages-template.php#L1758
https://buddypress.trac.wordpress.org/browser/tags/3.1.0/src/bp-messages/bp-messages-template.php#L1863

Closing this one.

Note: See TracTickets for help on using tickets.