Hey,
I'm having a CPT "Events" with a MB Relationship to WP Users. I can (re)order the added Users inside the single Event edit page but whenever I try to get the users with the following code the order isn't the same like inside the admin edit page:
$users = get_users( [
'relationship' => [
'id' => 'users_to_events',
'to' => get_the_ID(), // You can pass object ID or full object
],
] );
foreach ( $users as $user ) {
echo $user->display_name;
}
Any ideas how I can get the same order like in the edit page?
Thank you!