Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change the selection option from “Last Active” to “Alphabetical” by default


  • javigandia
    Participant

    @javigandia

    Hello everyone!
    I would like to know if it is possible that on the members home page instead of appearing by default the select option in “Last Active” could be “Alphabetical”.
    Thank you very much in advance.
    Buddypress seems like a great plugin to me.

Viewing 5 replies - 1 through 5 (of 5 total)

  • michaelabf
    Participant

    @michaelabf

    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 );

    javigandia
    Participant

    @javigandia

    Funciona perfectamente muchísimas gracias.


    GCF
    Participant

    @gcf

    he encontrado otros hilos pidiendo esta misma funcionalidad y esta funciona de maravilla. ¡por fin, muchas gracias!


    GCF
    Participant

    @gcf

    sorry, i have tested but i think it only changes default order of options but doesn’t display users alphabetically ordered


    GCF
    Participant

    @gcf

    i said nothing, it was my fault. works like a charm. i was not correctyly updating to nouveau theme

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar