Changeset 7813
- Timestamp:
- 02/06/2014 08:33:50 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-notifications/bp-notifications-classes.php
r7711 r7813 123 123 $data_format = array( '%d', '%d', '%d', '%s', '%s', '%s', '%d' ); 124 124 125 do_action_ref_array( 'bp_notification_before_save', array( &$this ) ); 126 125 127 // Update 126 128 if ( ! empty( $this->id ) ) { … … 139 141 $retval = $wpdb->insert_id; 140 142 } 143 144 do_action_ref_array( 'bp_notification_after_save', array( &$this ) ); 141 145 142 146 // Return the result … … 674 678 $where = self::get_query_clauses( $args ); 675 679 680 do_action( 'bp_notification_before_delete', $args ); 681 676 682 return self::_delete( $where['data'], $where['format'] ); 677 683 } -
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; -
trunk/bp-notifications/bp-notifications-loader.php
r7758 r7813 50 50 'template', 51 51 'functions', 52 'cache', 52 53 ); 53 54
Note: See TracChangeset
for help on using the changeset viewer.