No, that’s not the right place to look. The drop down is set up in a front end theme file: post-form.php in the activity folder of the bp-default theme.
In your child and / or bespoke theme, add a post-form.php file modified as you need to reorder the drop down.
Perfect – all sorted – thank you!!! (I guess I’ll have to test it a bit more for folks with more than one group though…
Have a good weekend…
Another point I just realised, it will now default to the custom group someone is a member of, rather than ‘my profile’. It sorts multiple groups by their ID, the highest ID is the one that get’s selected…
This is the code I’ve got from lines 33 – 71 in post-form.php in the theme (BuddyPress Corporate)
`
<input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="" />
:
<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) :
while ( bp_groups() ) : bp_the_group(); ?>
<option selected="selected" value="">
<?php endwhile;
endif; ?>
<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="" />
`
The key here is this line of PHP:
`<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) :
while ( bp_groups() ) : bp_the_group(); ?>`
Ideally you would want to not output the group right away. You would want the group information to go into a variable for processing. The proper way to do this is with a new plugin or template file.
So grab all the group names `bp_group_name()` and ids `bp_group_id()` into a PHP array and then run a new loop once you’ve resorted the array.