bp_get_notifications_unread_permalink

Return the unread notifications permalink.

Description

(string) bp_get_notifications_unread_permalink( (int) $user_id = 0 ); 

Returns (string)

Unread notifications permalink.

Parameters (1)

0. $user_id — Optional. (int)
The user id.

Usage

  1. if ( !function_exists( 'bp_get_notifications_unread_permalink' ) ) { 
  2. require_once '/bp-notifications/bp-notifications-template.php'; 
  3.  
  4. // The user id. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_get_notifications_unread_permalink($user_id); 
  9.  

Defined (1)

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

/bp-notifications/bp-notifications-template.php  
  1. function bp_get_notifications_unread_permalink( $user_id = 0 ) { 
  2. if ( 0 === $user_id ) { 
  3. $user_id = bp_loggedin_user_id(); 
  4. $domain = bp_loggedin_user_domain(); 
  5. } else { 
  6. $domain = bp_core_get_user_domain( (int) $user_id ); 
  7.  
  8. $retval = trailingslashit( $domain . bp_get_notifications_slug() . '/unread' ); 
  9.  
  10. /** 
  11. * Filters the unread notifications permalink. 
  12. * @since 1.9.0 
  13. * @since 2.6.0 Added $user_id as a parameter. 
  14. * @param string $retval Permalink for the unread notifications. 
  15. * @param int $user_id The user ID. 
  16. */ 
  17. return apply_filters( 'bp_get_notifications_unread_permalink', $retval, $user_id );