Changeset 6479
- Timestamp:
- 10/31/2012 10:41:57 AM (13 years ago)
- Location:
- trunk/bp-activity
- Files:
-
- 2 edited
-
bp-activity-admin.php (modified) (1 diff)
-
bp-activity-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-admin.php
r6350 r6479 1173 1173 * Markup for the "filter" part of the form (i.e. which activity type to display) 1174 1174 * 1175 * @global object $bp BuddyPress global settings1176 1175 * @param string $which 'top' or 'bottom' 1177 1176 * @since BuddyPress (1.6) 1178 1177 */ 1179 1178 function extra_tablenav( $which ) { 1180 global $bp;1181 1182 1179 if ( 'bottom' == $which ) 1183 1180 return; 1184 1181 1185 $actions = array();1186 1182 $selected = !empty( $_REQUEST['activity_type'] ) ? $_REQUEST['activity_type'] : ''; 1187 1183 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(); 1203 1186 natsort( $actions ); 1204 1187 ?> -
trunk/bp-activity/bp-activity-functions.php
r6359 r6479 235 235 236 236 return apply_filters( 'bp_activity_get_action', $bp->activity->actions->{$component_id}->{$key}, $component_id, $key ); 237 } 238 239 /** 240 * Fetch details of all registered activity types 241 * 242 * @return array array( type => description ), ... 243 * @since BuddyPress (1.7) 244 */ 245 function bp_activity_get_types() { 246 $actions = array(); 247 248 // Walk through the registered actions, and build an array of actions/values. 249 foreach ( buddypress()->activity->actions as $action ) { 250 $action = array_values( (array) $action ); 251 252 for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) 253 $actions[ $action[$i]['key'] ] = $action[$i]['value']; 254 } 255 256 // This was a mis-named activity type from before BP 1.6 257 unset( $actions['friends_register_activity_action'] ); 258 259 // This type has not been used since BP 1.0.3. It will be re-instated in a future version. 260 unset( $actions['updated_profile'] ); 261 262 return apply_filters( 'bp_activity_get_types', $actions ); 237 263 } 238 264
Note: See TracChangeset
for help on using the changeset viewer.