get_users() not showing the correct order of relationship

Support MB Relationships get_users() not showing the correct order of relationshipResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43102
    manuel@wp-cologne.de[email protected]
    Participant

    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!

    #43108
    PeterPeter
    Moderator

    Hello,

    Thanks for your feedback.

    There is an issue with the order of connected users when displaying them in the frontend. I've escalated this issue to the development team to fix it. I will let you know when I have any information.

    #43181
    manuel@wp-cologne.de[email protected]
    Participant

    Hey Peter,

    thank you. There seems to be another issue with the order of the related users. When I didn't change the order of the related users in the specific post all new users are added at the end of the list (which is correct, picture 1). As soon as I change the order (picture 2) and add another users via MB_Relationships_API::add the order seems to be completely random (picture 3).

    Should I open a new post or are they related?

    Thanks,
    Manuel

    #43206
    PeterPeter
    Moderator

    Hello,

    Please open a new topic and attach the screenshots. This ticket will focus on the display relationship users in the frontend.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.