Changeset 10515 for trunk/src/bp-activity/bp-activity-functions.php
- Timestamp:
- 02/05/2016 03:37:27 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-functions.php
r10457 r10515 385 385 'position' => $position, 386 386 ), $component_id, $type, $description, $format_callback, $label, $context ); 387 388 // Sort the actions of the affected component. 389 $action_array = (array) $bp->activity->actions->{$component_id}; 390 $action_array = bp_sort_by_key( $action_array, 'position', 'num' ); 391 392 // Restore keys. 393 $bp->activity->actions->{$component_id} = new stdClass; 394 foreach ( $action_array as $key_ordered ) { 395 $bp->activity->actions->{$component_id}->{$key_ordered['key']} = $key_ordered; 396 } 387 397 388 398 return true; … … 571 581 $post_type->position 572 582 ); 573 }574 }575 576 // Sort the actions by their position within each component.577 foreach ( $bp->activity->actions as $component => $actions ) {578 $actions = (array) $actions;579 $temp = bp_sort_by_key( $actions, 'position', 'num' );580 581 // Restore keys.582 $bp->activity->actions->{$component} = new stdClass;583 foreach ( $temp as $key_ordered ) {584 $bp->activity->actions->{$component}->{$key_ordered['key']} = $key_ordered;585 583 } 586 584 }
Note: See TracChangeset
for help on using the changeset viewer.