bp_core_get_notifications_for_user

Get notifications for a specific user.

Description

(boolean) bp_core_get_notifications_for_user( (int) $user_id, (string) $format = 'string' ); 

Returns (boolean)

Object or array on success, false on failure.

Parameters (2)

0. $user_id (int)
The user id.
1. $format — Optional. (string) => 'string'
The format.

Usage

  1. if ( !function_exists( 'bp_core_get_notifications_for_user' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/deprecated/1.9.php'; 
  3.  
  4. // The user id. 
  5. $user_id = -1; 
  6.  
  7. // The format. 
  8. $format = 'string'; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_core_get_notifications_for_user($user_id, $format); 
  12.  

Defined (1)

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

/bp-core/deprecated/1.9.php  
  1. function bp_core_get_notifications_for_user( $user_id, $format = 'string' ) { 
  2.  
  3. // Bail if notifications is not active 
  4. if ( ! bp_is_active( 'notifications' ) ) { 
  5. return false; 
  6.  
  7. // Trigger the deprecated function notice 
  8. _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_get_notifications_for_user()' ); 
  9.  
  10. return bp_notifications_get_notifications_for_user( $user_id, $format );