Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/31/2012 10:41:57 AM (12 years ago)
Author:
djpaul
Message:

Add new function to get details of all registered activity types

  • This was taken from part of the list table code for the Activity admin screens
  • Activity admin list table has been updated to use this function
  • It will be re-used in template functions to be added in future commits
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-admin.php

    r6350 r6479  
    11731173     * Markup for the "filter" part of the form (i.e. which activity type to display)
    11741174     *
    1175      * @global object $bp BuddyPress global settings
    11761175     * @param string $which 'top' or 'bottom'
    11771176     * @since BuddyPress (1.6)
    11781177     */
    11791178    function extra_tablenav( $which ) {
    1180         global $bp;
    1181 
    11821179        if ( 'bottom' == $which )
    11831180            return;
    11841181
    1185         $actions  = array();
    11861182        $selected = !empty( $_REQUEST['activity_type'] ) ? $_REQUEST['activity_type'] : '';
    11871183
    1188         // Walk through the registered actions, and build an array of actions/values.
    1189         foreach ( $bp->activity->actions as $action ) {
    1190             $action = array_values( (array) $action );
    1191 
    1192             for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ )
    1193                 $actions[ $action[$i]['key'] ] = $action[$i]['value'];
    1194         }
    1195 
    1196         // This was a mis-named activity type from before BP 1.6
    1197         unset( $actions['friends_register_activity_action'] );
    1198 
    1199         // This type has not been used since BP 1.0.3. It will be re-instated in a future version.
    1200         unset( $actions['updated_profile'] );
    1201 
    1202         // Sort array by the human-readable value
     1184        // Get all types of activities, and sort alphabetically.
     1185        $actions  = bp_activity_get_types();
    12031186        natsort( $actions );
    12041187    ?>
Note: See TracChangeset for help on using the changeset viewer.