bp_activity_admin_get_activity_actions()

Get flattened array of all registered activity actions.


Description Description

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


Return Return

(array) $actions


Top ↑

Source Source

File: bp-activity/bp-activity-admin.php

function bp_activity_admin_get_activity_actions() {
	$actions  = array();

	// Walk through the registered actions, and build an array of actions/values.
	foreach ( bp_activity_get_actions() as $action ) {
		$action = array_values( (array) $action );

		for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) {
			/**
			 * Don't take in account:
			 * - a mis-named Friends activity type from before BP 1.6,
			 * - The Group's component 'activity_update' one as the Activity component is using it.
			 */
			if ( 'friends_register_activity_action' === $action[$i]['key'] || 'bp_groups_format_activity_action_group_activity_update' === $action[$i]['format_callback'] ) {
				continue;
			}

			$actions[ $action[$i]['key'] ] = $action[$i]['value'];
		}
	}

	// Sort array by the human-readable value.
	natsort( $actions );

	return $actions;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.