- Timestamp:
- 10/15/2020 04:33:31 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/classes/class-bp-notifications-notification.php
r11888 r12753 557 557 * false. 558 558 */ 559 public static function check_access( $user_id , $notification_id) {559 public static function check_access( $user_id = 0, $notification_id = 0 ) { 560 560 global $wpdb; 561 561 562 562 $bp = buddypress(); 563 563 564 return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) ); 564 $query = "SELECT COUNT(id) FROM {$bp->notifications->table_name} WHERE id = %d AND user_id = %d"; 565 $prepare = $wpdb->prepare( $query, $notification_id, $user_id ); 566 $result = $wpdb->get_var( $prepare ); 567 568 return $result; 565 569 } 566 570
Note: See TracChangeset
for help on using the changeset viewer.