mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-01 11:52:25 +08:00
https://docs.ultimatemember.com/article/1737-enable-account-status-sorting-in-member-directories
20 lines
521 B
Text
20 lines
521 B
Text
add_action("um_user_before_query","um_052422_orderby_profile_photo", 999999999, 2 );
|
|
function um_052422_orderby_profile_photo( $query_args, $obj ) {
|
|
|
|
$obj->query_args['meta_query'][ ] = array(
|
|
'relation' => 'OR',
|
|
'wxo_featured_clause' => array(
|
|
'key' => 'account_status',
|
|
'compare' => 'awaiting_admin_review'
|
|
),
|
|
array(
|
|
"key" => 'account_status',
|
|
),
|
|
|
|
);
|
|
|
|
$obj->query_args['orderby'] = array(
|
|
'wxo_featured_clause' => 'DESC',
|
|
'user_registered' => 'DESC',
|
|
);
|
|
}
|