bp_get_the_notification_delete_link

Return the delete link for the current notification.

Description

(string) bp_get_the_notification_delete_link( (int) $user_id = 0 ); 

Returns (string)

Parameters (1)

0. $user_id — Optional. (int)
The user id.

Usage

  1. if ( !function_exists( 'bp_get_the_notification_delete_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-notifications/bp-notifications-template.php'; 
  3.  
  4. // The user id. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_get_the_notification_delete_link($user_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-notifications/bp-notifications-template.php  
  1. function bp_get_the_notification_delete_link( $user_id = 0 ) { 
  2. // Set default user ID to use. 
  3. $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id; 
  4.  
  5. $retval = sprintf( '<a href="%1$s" class="delete secondary confirm">%2$s</a>', esc_url( bp_get_the_notification_delete_url( $user_id ) ), __( 'Delete', buddypress ) ); 
  6.  
  7. /** 
  8. * Filters the delete link for the current notification. 
  9. * @since 1.9.0 
  10. * @since 2.6.0 Added $user_id as a parameter. 
  11. * @param string $retval HTML for the delete link for the current notification. 
  12. * @param int $user_id The user ID. 
  13. */ 
  14. return apply_filters( 'bp_get_the_notification_delete_link', $retval, $user_id );