bp_get_the_notification_mark_unread_url( int $user_id )

Return the URL used for marking a single notification as unread.


Parameters Parameters

$user_id

(int) (Required) The user ID.


Top ↑

Return Return

(string)


Source Source

File: bp-notifications/bp-notifications-template.php

	function bp_get_the_notification_mark_unread_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'          => 'unread',
			'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_read_permalink( $user_id ) );

		// Add the nonce.
		$url = wp_nonce_url( $url, 'bp_notification_mark_unread_' . $id );

		/**
		 * Filters the URL used for marking a single notification as unread.
		 *
		 * @since 2.1.0
		 * @since 2.6.0 Added $user_id as a parameter.
		 *
		 * @param string $url     URL to use for marking the single notification as unread.
		 * @param int    $user_id The user ID.
		 */
		return apply_filters( 'bp_get_the_notification_mark_unread_url', $url, $user_id );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Added $user_id as a parameter.
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.