bp_activity_action_remove_favorite

Remove activity from favorites.

Description

bp_activity_action_remove_favorite(); 

Usage

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

Defined (1)

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

/bp-activity/bp-activity-actions.php  
  1. function bp_activity_action_remove_favorite() { 
  2.  
  3. if ( ! is_user_logged_in() || ! bp_is_activity_component() || ! bp_is_current_action( 'unfavorite' ) ) 
  4. return false; 
  5.  
  6. // Check the nonce. 
  7. check_admin_referer( 'unmark_favorite' ); 
  8.  
  9. bp_core_add_message( __( 'Activity removed as favorite.', buddypress ) ); 
  10. else 
  11. bp_core_add_message( __( 'There was anerrorremoving that activity as a favorite. Please try again.', buddypress ), error ); 
  12.  
  13. bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );