Try changing the priority from the default of 10.
For example:
add_action ( 'bp_pre_user_query', 'remove_orderby', 99 );
or
add_action ( 'bp_pre_user_query', 'remove_orderby', 2 );
Or try using the filter:
$sql = apply_filters_ref_array( 'bp_user_query_uid_clauses', array( $sql, &$this ) );
Hello shanebp,
Thank you for response. Change the priority dont change the behaviour. When i declare the action to remove_orderby in all situations dont retrieve users on frontend.
The next try i dont understand in which context i have try this
For a better understanding, my code basically works as follows:
$empresas = get_empresas();
if (!empty($empresas) and bp_has_members($empresas . "&per_page=28")){
echo "<div id='buatp_members' class='grid_view'>";
...
The $empresas get the complete include parameter like this: include=1000,1001,1002
The next line begins the build of user list content.
is possible correctly extend the bp_has_members() function to get this approach?
Have you read this codex page?
Note the section at the bottom: ‘Preserve the Order’
Thanks for your support Shanebp.
I undestand the example in the codex page but im not sure in how to implement this because i pass the complete string “include=” to function bp_has_members like described above.
I need instance the class in exemple and call bp_has_members without parameters?
Guys,
I need some help with this. I have no idea how to implement this solution using the hook bp_pre_user_query_construct. Please help me with this issue at least some basic example.
My problem is that i call bp_has_members on the loop like this:
$profissionais = "include=1,2,3,4,5,6";
if (!empty($profissionais) and bp_has_members($profissionais . "&per_page=28")){
I dont have ideia in how to call bp_has_member in bp_pre_user_query_construct context .
Thank you.