diff --git src/bp-activity/bp-activity-functions.php src/bp-activity/bp-activity-functions.php
index b5e8a93..a908342 100644
|
|
function bp_activity_get_actions() { |
554 | 554 | |
555 | 555 | $post_types = bp_activity_get_post_types_tracking_args(); |
556 | 556 | |
| 557 | $do_sort = false; |
| 558 | |
557 | 559 | // Create the actions for the post types, if they haven't already been created. |
558 | 560 | if ( ! empty( $post_types ) ) { |
559 | 561 | foreach ( $post_types as $post_type ) { |
… |
… |
function bp_activity_get_actions() { |
570 | 572 | $post_type->contexts, |
571 | 573 | $post_type->position |
572 | 574 | ); |
| 575 | |
| 576 | $do_sort = true; |
573 | 577 | } |
574 | 578 | } |
575 | 579 | |
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 | // If the actions have been modified, sort by their position within each component. |
| 581 | if ( $do_sort ) { |
| 582 | foreach ( $bp->activity->actions as $component => $actions ) { |
| 583 | $actions = (array) $actions; |
| 584 | $temp = bp_sort_by_key( $actions, 'position', 'num' ); |
580 | 585 | |
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; |
| 586 | // Restore keys. |
| 587 | $bp->activity->actions->{$component} = new stdClass; |
| 588 | foreach ( $temp as $key_ordered ) { |
| 589 | $bp->activity->actions->{$component}->{$key_ordered['key']} = $key_ordered; |
| 590 | } |
585 | 591 | } |
586 | 592 | } |
587 | 593 | |