The auto created relationship has an extra taxonomy in it?

Support MB Relationships The auto created relationship has an extra taxonomy in it?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42780
    YasmineYasmine
    Participant

    Hello, I am having an issue setting a relationship programatically and when I looked in the code I saw that there is 'taxonomy' => 'category' being added, is this right? / Do you know why this is appearing?

    <?php
    add_action( 'mb_relationships_init', 'your_prefix_function_name' );

    function your_prefix_function_name() {
        MB_Relationships_API::register( [
            'id'         => 'university_user',
            'reciprocal' => true,
            'from'       => [
                'object_type'  => 'post',
                'post_type'    => 'university',
                'admin_column' => [
                    'position' => 'after tags',
                    'link'     => 'view',
                ],
                'meta_box'     => [
                    'title' => 'User',
                ],
                'field'        => [
                    'query_args' => [
                        'orderby' => 'title',
                        'order'   => 'ASC',
                    ],
                    'max_clone'  => '1',
                ],
            ],
            'to'         => [
                'object_type' => 'user',
                'post_type'   => 'post',
                'taxonomy'    => 'category', //Is this needed? 
                'meta_box'    => [
                    'title'    => 'University / Institution',
                    'priority' => 'high',
                ],
                'field'       => [
                    'query_args' => [
                        'orderby' => 'title',
                        'order'   => 'ASC',
                    ],
                ],
            ],
        ] );
    }
    #42784
    PeterPeter
    Moderator

    Hello,

    Thanks for your feedback.

    It is redundant, I will inform the development team to remove it when generating PHP code.

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