Erase Alphabetical Sort
-
How to erase Alphabetical sort? It’s not useful for Japanese language. I use WordPress 5.7.2
-
Use the filter hook to unset that element from the options array.
This is the hook:
apply_filters( 'bp_nouveau_get_members_filters', $filters, $context );
Found in:buddypress\bp-templates\bp-nouveau\includes\members\functions.php
function mitsuh_remove_alphabetical( $filters, $context ) { unset( $filters['alphabetical'] ); return $filters; } add_filter('bp_nouveau_get_members_filters', 'mitsuh_remove_alphabetical', 20, 2 );
Put it in your theme > functions.php
Thank you very much.
But I can’t findapply_filters( ‘bp_nouveau_get_members_filters’, $filters, $context );
in
buddypress\bp-templates\bp-nouveau\includes\members\functions.php
I checked the code in functions.php.
But I couldn’t find.I am not good at writing code.
How to find the code in functions.php?
How to put this code, too?
function mitsuh_remove_alphabetical( $filters, $context ) {
unset( $filters[‘alphabetical’] );
return $filters;
}
add_filter(‘bp_nouveau_get_members_filters’, ‘mitsuh_remove_alphabetical’, 20, 2 );Please let me know.
Copy the function that I wrote for you and paste it in the functions.php file in your theme.
Thank you very very much.
I put the code in the of functions.php like this.
But it doesn’t work.
I can still see the alphabetical sort in the page.remove_filter( ‘_bp_nouveau_member_reset_front_template’, ‘bp_nouveau_member_restrict_user_front_templates’, 10, 1 );
$nav = buddypress()->members->nav;
// Eventually reset the order.
bp_nouveau_set_nav_item_order( $nav, bp_nouveau_get_appearance_settings( ‘user_nav_order’ ) );return $nav->get_primary();
function mitsuh_remove_alphabetical( $filters, $context ) {
unset( $filters[‘alphabetical’] );
return $filters;
}
add_filter(‘bp_nouveau_get_members_filters’, ‘mitsuh_remove_alphabetical’, 20, 2 );
}That function has been tested and it works.
So you pasted it in the wrong place.
Try pasting it after the last}
in the code that you put in your last reply.
And please use the CODE button when including code.Just add this:
add_filter('bp_nouveau_get_groups_filters', 'mitsuh_remove_alphabetical', 20, 2 );
Awesome!
Thank you very very very much!
I could make it!I love BuddyPress.
I was thinking which one is good for me, BuddyPress or BuddyBoss before I use BuddyPress.
BuddyPress is so GOOD!
So, I will use BuddyPress forever.
- You must be logged in to reply to this topic.