Changeset 5595 for trunk/bp-core/bp-core-classes.php
- Timestamp:
- 12/24/2011 03:37:55 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-classes.php
r5479 r5595 746 746 * @global wpdb $wpdb WordPress database object 747 747 * @param integer $user_id User ID 748 * @param str $status 'is_new' or 'all' 748 749 * @return array Associative array 749 750 * @static 750 751 */ 751 function get_all_for_user( $user_id ) {752 function get_all_for_user( $user_id, $status = 'is_new' ) { 752 753 global $bp, $wpdb; 753 754 754 return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND is_new = 1", $user_id ) ); 755 $is_new = 'is_new' == $status ? ' AND is_new = 1 ' : ''; 756 757 return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d {$is_new}", $user_id ) ); 755 758 } 756 759
Note: See TracChangeset
for help on using the changeset viewer.