ap_count_unseen_notifications( integer $user_id = false )
Description #
Count total numbers of unread notifications of a user.
Parameters #
- $user_idinteger (Optional) User id. Default value: false
Source #
File: addons/notifications/functions.php
function ap_count_unseen_notifications( $user_id = false ) { if ( false === $user_id ) { $user_id = get_current_user_id(); } global $wpdb; $count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}ap_notifications WHERE noti_user_id = %d AND noti_seen = 0", $user_id ) ); // phpcs:ignore WordPress.DB return $count; }
Expand full source code Collapse full source code View on GitHub: addons/notifications/functions.php:306
Add your comment