bp_get_notifications_permalink( int $user_id )

Return the notifications permalink.

Description

Parameters

$user_id

(Required) The user ID.

Return

(string) Notifications permalink.

Source

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

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
function bp_get_notifications_permalink( $user_id = 0 ) {
    if ( 0 === $user_id ) {
        $user_id = bp_loggedin_user_id();
        $domain  = bp_loggedin_user_domain();
    } else {
        $domain = bp_core_get_user_domain( (int) $user_id );
    }
 
    $retval = trailingslashit( $domain . bp_get_notifications_slug() );
 
    /**
     * Filters the notifications permalink.
     *
     * @since BuddyPress 1.9.0
     * @since BuddyPress 2.6.0 Added $user_id as a parameter.
     *
     * @param string $retval  Permalink for the notifications.
     * @param int    $user_id The user ID.
     */
    return apply_filters( 'bp_get_notifications_permalink', $retval, $user_id );
}

Changelog

Changelog
Version Description
BuddyPress 2.6.0 Added $user_id as a parameter. BuddyPress 2.6.0 Added $user_id as a parameter.
BuddyPress 1.9.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.