bp_get_activity_delete_url

Return the URL to delete a single activity item.

Description

(string) bp_get_activity_delete_url(); 

Returns (string)

$link Activity delete link. Contains $redirect_to arg if on single activity page.


Usage

  1. if ( !function_exists( 'bp_get_activity_delete_url' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_activity_delete_url(); 
  7.  

Defined (1)

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

/bp-activity/bp-activity-template.php  
  1. function bp_get_activity_delete_url() { 
  2. global $activities_template; 
  3.  
  4. $url = trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/delete/' . $activities_template->activity->id ); 
  5.  
  6. // Determine if we're on a single activity page, and customize accordingly. 
  7. if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) { 
  8. $url = add_query_arg( array( 'redirect_to' => wp_get_referer() ), $url ); 
  9.  
  10. $url = wp_nonce_url( $url, 'bp_activity_delete_link' ); 
  11.  
  12. /** 
  13. * Filters the activity delete URL. 
  14. * @since 2.1.0 
  15. * @param string $url Activity delete URL. 
  16. */