Hello @webmark487,
Thanks for reaching us!
You can use this snippet below to achieve that ??
<?php
/**
* Select Alphabet on Select Box.
*/
function yzc_make_alphabet_selected() {
?>
<script type="text/javascript">
( function( $ ) {
$( document ).ready( function() {
jQuery( '#members-order-by option[value="alphabetical"], #groups-order-by option[value="alphabetical"]' ).attr( 'selected', true );
});
})( jQuery );
</script>
<?php
}
add_action( 'wp_footer', 'yzc_make_alphabet_selected' );
/**
* Members Directory - Set Default Filter.
*/
function yzc_set_default_members_directory_filter( $loop ) {
if ( bp_is_members_directory() && ! isset( $_POST['filter'] ) ) {
$loop['type'] = 'alphabetical';
}
return $loop;
}
add_filter( 'bp_after_has_members_parse_args', 'yzc_set_default_members_directory_filter', 9999 );
/**
* Members Directory - Set Default Filter.
*/
function yzc_set_default_groups_directory_filter( $loop ) {
if ( bp_is_groups_directory() && ! isset( $_POST['filter'] ) ) {
$loop['type'] = 'alphabetical';
}
return $loop;
}
add_filter( 'bp_after_has_groups_parse_args', 'yzc_set_default_groups_directory_filter', 9999 );
Let us know if it worked fine for you!
Best Regards.