Relationship field in user registration

Support MB User Profile Relationship field in user registration

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #38708
    YasmineYasmine
    Participant

    Hi Long,

    I have been following this documentation to edit the default fields: https://docs.metabox.io/extensions/mb-user-profile/#edit-default-fields

    I want to include a relationship field within the order. However, it doesn't work when I try to add it as a new field.

    I am adding it like this:

    	[ 'name'          => __( 'University', 'your-text-domain' ),
    			   'type' => 'select',
    			    'id'   => 'university_user',
            'from' => [
                'object_type' => 'post',
                'post_type'   => 'university',
                    'max_clone'  => '1',
                ],
    			        ],
            'to'   => [
                'object_type' => 'user',
                'post_type'   => 'post',
                'taxonomy'    => 'category',
    		],],

    What am I doing wrong?

    #38714
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The relationship is registered in a new/separate meta box and it is not a standard field type to re-order like default fields. You can use the object fields like post to do that. Please read more on the documentation https://docs.metabox.io/fields/post/

    #38716
    YasmineYasmine
    Participant

    Thanks Long, that clarifies.

    But if I use the post field, how do I update the relationship field too? I use the relationship to query both ways on other parts of the site, so important this is also updated

    #38729
    Long NguyenLong Nguyen
    Moderator

    Hi,

    If you are familiar with coding, you can follow this documentation to know how to set a connection between two objects manually https://docs.metabox.io/extensions/mb-relationships/#creating-connections-programmatically

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