Changeset 7813 for trunk/bp-notifications/bp-notifications-functions.php
- Timestamp:
- 02/06/2014 08:33:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-notifications/bp-notifications-functions.php
r7732 r7813 122 122 123 123 // Setup local variables 124 $bp = buddypress(); 125 $notifications = BP_Notifications_Notification::get( array( 126 'user_id' => $user_id 127 ) ); 124 $bp = buddypress(); 125 126 // Get notifications out of the cache, or query if necessary 127 $notifications = wp_cache_get( 'all_for_user_' . $user_id, 'bp_notifications' ); 128 if ( false === $notifications ) { 129 $notifications = BP_Notifications_Notification::get( array( 130 'user_id' => $user_id 131 ) ); 132 wp_cache_set( 'all_for_user_' . $user_id, $notifications, 'bp_notifications' ); 133 } 134 128 135 $grouped_notifications = array(); // Notification groups 129 136 $renderable = array(); // Renderable notifications … … 500 507 501 508 // Get the notifications, and count them 502 $notifications = BP_Notifications_Notification::get( array( 503 'user_id' => $user_id, 504 ) ); 509 $notifications = wp_cache_get( 'all_for_user_' . $user_id, 'bp_notifications' ); 510 if ( false === $notifications ) { 511 $notifications = BP_Notifications_Notification::get( array( 512 'user_id' => $user_id, 513 ) ); 514 wp_cache_set( 'all_for_user_' . $user_id, $notifications, 'bp_notifications' ); 515 } 505 516 506 517 $count = ! empty( $notifications ) ? count( $notifications ) : 0;
Note: See TracChangeset
for help on using the changeset viewer.