bp_get_message_thread_view_link

Get the permalink of a particular thread.

Description

(string) bp_get_message_thread_view_link( (int) $thread_id = 0 ); 

Returns (string)

Parameters (1)

0. $thread_id — Optional. (int)
ID of the thread. Default: current thread being iterated on in the loop.

Usage

  1. if ( !function_exists( 'bp_get_message_thread_view_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-messages/bp-messages-template.php'; 
  3.  
  4. // Optional. ID of the thread. Default: current 
  5. // thread being iterated on in the loop. 
  6. $thread_id = -1; 
  7.  
  8. // NOTICE! Understand what this does before running. 
  9. $result = bp_get_message_thread_view_link($thread_id); 
  10.  

Defined (1)

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

/bp-messages/bp-messages-template.php  
  1. function bp_get_message_thread_view_link( $thread_id = 0 ) { 
  2. global $messages_template; 
  3.  
  4. if ( empty( $messages_template ) && (int) $thread_id > 0 ) { 
  5. $thread_id = (int) $thread_id; 
  6. } elseif ( ! empty( $messages_template->thread->thread_id ) ) { 
  7. $thread_id = $messages_template->thread->thread_id; 
  8.  
  9. /** 
  10. * Filters the permalink of a particular thread. 
  11. * @since 1.0.0 
  12. * @since 2.6.0 Added the `$thread_id` parameter. 
  13. * @param string $value Permalink of a particular thread. 
  14. * @param int $thread_id ID of the thread. 
  15. */