bp_has_message_threads

Filters if there are any message threads to display in inbox/sentbox/notices.

Description

apply_filters( 'bp_has_message_threads', (bool) $messages_template_has_threads, (BP_Messages_Box_Template) $messages_template, (array) $r ); 

Parameters (3)

0. $messages_template_has_threads (bool)
Whether or not the message has threads.
1. $messages_template (BP_Messages_Box_Template)
Current message box template object.
2. $r (array)
Array of parsed arguments passed into function.

Usage

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

Defined (1)

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

/bp-messages/bp-messages-template.php  
  1. return apply_filters( 'bp_has_message_threads', $messages_template->has_threads(), $messages_template, $r );