Hi all,
I want to have the groups sorted alphabetically, unless the user picks his own sorting via dropdown Box.
I tried the custom code:
add_filter('bp_after_has_groups_parse_args', 'wbcom_theme_alter_groups_parse_args');
function wbcom_theme_alter_groups_parse_args($options)
{
if (bp_is_groups_directory()) {
if(!$options['type'])
$options['type'] = 'alphabetical';
}
return $options;
}
As per documentation, $options[‘type’] is “null” when the user has NOT yet picked an option in the dropdown, i.e. when it’s the initial sorting.
But it does not seem to work.
Any ideas?