Can't save more of 10 Relationships from Admin

Support MB Relationships Can't save more of 10 Relationships from AdminResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21076
    RijaRatinahiranaRijaRatinahirana
    Participant

    Hello,

    I have a relationship set up between a custom post type and users :

       // Add Att Group / Host User Relationship
        MB_Relationships_API::register([
            'id' => 'att_group_host_to_user',
            'from' => [
                'object_type' => 'post',
                'post_type' => 'ot-att-group',
                'meta_box' => [
                    'title' => 'Host',
                    'context' => 'normal',
                ],
            ],
            'to' => [
                'object_type' => 'user',
                'meta_box' => [
                    'title' => 'Host of Groups',
                    'context' => 'normal',
                ],
            ],
        ]);

    If I add more than 10 users to the post using the cloneable dropdowns, only 10 are saved, the others are there but are shown empty.

    Admin Screenshot

    Any clues what is going on ?

    Many thanks 🙂

    #21080
    Long NguyenLong Nguyen
    Moderator

    Hi,

    By default, the object type user shows 10 items if you want to change the number, please use the setting query_args

    MB_Relationships_API::register([
        'id' => 'att_group_host_to_user',
        'from' => [
            'object_type' => 'post',
            'post_type' => 'ot-att-group',
            'meta_box' => [
                'title' => 'Host',
                'context' => 'normal',
            ],
        ],
        'to' => [
            'object_type' => 'user',
            'meta_box' => [
                'title' => 'Host of Groups',
                'context' => 'normal',
            ],
            'field' => [
                'query_args' => [
                    'number' => 15 // This
                ]
            ]
        ],
    ]);

    For more information, please follow the documentation https://docs.metabox.io/extensions/mb-relationships/#syntax.

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