I made a small change so that the user can choose the sort order, but can anyone tell me why it does not work?
function custom_bbp_has_topics($order) {
switch ($order) {
case 1:
$args['order'] = 'ASC';
break;
case 2:
$args['order'] = 'DESC';
break;
default:
$args['order'] = 'DESC';
}
return $args;
}
add_filter('bbp_before_has_topics_parse_args', 'custom_bbp_has_topics' );