bp_get_the_notification_mark_read_url( int $user_id )
Return the URL used for marking a single notification as read.
Description
Parameters
- $user_id
-
(Required) The user ID.
Return
(string)
Source
File: bp-notifications/bp-notifications-template.php
597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 | function bp_get_the_notification_mark_read_url( $user_id = 0 ) { // Get the notification ID. $id = bp_get_the_notification_id(); // Get the args to add to the URL. $args = array ( 'action' => 'read' , 'notification_id' => $id ); // Set default user ID to use. $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id ; // Add the args to the URL. $url = add_query_arg( $args , bp_get_notifications_unread_permalink( $user_id ) ); // Add the nonce. $url = wp_nonce_url( $url , 'bp_notification_mark_read_' . $id ); /** * Filters the URL used for marking a single notification as read. * * @since BuddyPress 2.1.0 * @since BuddyPress 2.6.0 Added $user_id as a parameter. * * @param string $url URL to use for marking the single notification as read. * @param int $user_id The user ID. */ return apply_filters( 'bp_get_the_notification_mark_read_url' , $url , $user_id ); } |
Changelog
Version | Description |
---|---|
BuddyPress 2.6.0 Added $user_id as a parameter. | BuddyPress 2.6.0 Added $user_id as a parameter. |
BuddyPress 2.1.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.