bp_activity_action_mark_favorite

Mark activity as favorite.

Description

bp_activity_action_mark_favorite(); 

Usage

  1. if ( !function_exists( 'bp_activity_action_mark_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_mark_favorite(); 
  7.  

Defined (1)

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

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