Notifications::mark_notifications_seen()
Description #
Ajax callback for marking all notification of current user as seen.
Source #
File: addons/notifications/notifications.php
public function mark_notifications_seen() {
if ( ! is_user_logged_in() || ! anspress_verify_nonce( 'mark_notifications_seen' ) ) {
ap_ajax_json(
array(
'success' => false,
'snackbar' => array( 'message' => __( 'There was a problem processing your request', 'anspress-question-answer' ) ),
)
);
}
// Mark all notifications as seen.
ap_set_notifications_as_seen( get_current_user_id() );
ap_ajax_json(
array(
'success' => true,
'btn' => array( 'hide' => true ),
'snackbar' => array( 'message' => __( 'Successfully updated all notifications', 'anspress-question-answer' ) ),
'cb' => 'notificationAllRead',
)
);
wp_die();
}
Expand full source code Collapse full source code View on GitHub: addons/notifications/notifications.php:499
Add your comment