If you are using BP Nouveau then this code snippet should work:
function themename_bp_reorder_member_directory_filters( $filters, $context ) {
if ( 'group' !== $context ) {
$filters = array();
if ( bp_is_active( 'xprofile' ) ) {
$filters['alphabetical'] = __( 'Alphabetical', 'buddypress' );
}
$filters['active'] = __( 'Last Active', 'buddypress' );
$filters['newest'] = __( 'Newest Registered', 'buddypress' );
}
return $filters;
}
add_filter( 'bp_nouveau_get_members_filters', 'themename_bp_reorder_member_directory_filters', 10, 2 );
Funciona perfectamente muchísimas gracias.
he encontrado otros hilos pidiendo esta misma funcionalidad y esta funciona de maravilla. ¡por fin, muchas gracias!
sorry, i have tested but i think it only changes default order of options but doesn’t display users alphabetically ordered
i said nothing, it was my fault. works like a charm. i was not correctyly updating to nouveau theme
Looking for the same thing. What file do I add this snippet to?
sbanner, you can add it to functions.php or add it using Code Snippets plugin.
Thanks @thinlizzie. Worked perfectly adding to functions.php. BTW, love your username!