bp_activity_admin_get_activity_actions

Get flattened array of all registered activity actions.

Description

(array) bp_activity_admin_get_activity_actions(); 

Format is [activity_type] => Pretty name for activity type.

Returns (array)

$actions


Usage

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

Defined (1)

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

/bp-activity/bp-activity-admin.php  
  1. function bp_activity_admin_get_activity_actions() { 
  2. $actions = array(); 
  3.  
  4. // Walk through the registered actions, and build an array of actions/values. 
  5. foreach ( bp_activity_get_actions() as $action ) { 
  6. $action = array_values( (array) $action ); 
  7.  
  8. for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) { 
  9. $actions[ $action[$i]['key'] ] = $action[$i]['value']; 
  10.  
  11. // This was a mis-named activity type from before BP 1.6. 
  12. unset( $actions['friends_register_activity_action'] ); 
  13.  
  14. // Sort array by the human-readable value. 
  15. natsort( $actions ); 
  16.  
  17. return $actions;