messages_notification_new_message_message

Filters the message notification message that will be sent to user.

Description

apply_filters( 'messages_notification_new_message_message', (string) $value, (string) $tokens_sender_name, (string) $tokens_usersubject, (string) $tokens_content, (string) $tokens_message_url, (string) $var, (bool) $false ); 

Parameters (7)

0. $value (string)
Email notification message text.
1. $tokens_sender_name (string)
Name of the person who sent the message.
2. $tokens_usersubject (string)
Email notification subject text.
3. $tokens_content (string)
Content of the message.
4. $tokens_message_url (string)
URL permalink for the message.
5. $var (string) => ''
Removed in 2.5; now an empty string.
6. $false (bool) => false
Removed in 2.5; now a bool (false).

Usage

To run the hook, copy the example below.
  1. $value = apply_filters( 'messages_notification_new_message_message', $value, $tokens_sender_name, $tokens_usersubject, $tokens_content, $tokens_message_url, $var, $false ); 
  2.  
  3. if ( !empty( $value ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the messages_notification_new_message_message callback 
  2. function filter_messages_notification_new_message_message( $value, $tokens_sender_name, $tokens_usersubject, $tokens_content, $tokens_message_url, $var, $false ) { 
  3. // make filter magic happen here... 
  4. return $value
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'messages_notification_new_message_message', 'filter_messages_notification_new_message_message', 10, 7 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'messages_notification_new_message_message', 'filter_messages_notification_new_message_message', 10, 7 ); 

Defined (1)

The filter is defined in the following location(s).

/bp-core/deprecated/2.5.php  
  1. $value = apply_filters( 'messages_notification_new_message_message', $value, $tokens['sender.name'], $tokens['usersubject'], $tokens['content'], $tokens['message.url'], '', false );