Connecting a specific USER ROLE to a specific POST TYPE

Support MB Relationships Connecting a specific USER ROLE to a specific POST TYPE

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12584
    @mindspark@mindspark
    Participant

    I want to connect a specific user role (Contacts) to a CPT (Deals). your documentation says to do this

    add_action( 'mb_relationships_init', function () {
        MB_Relationships_API::register( array(
            'id'   => 'users_to_posts',
            'from' => array(
                'object_type' => 'user',
                'meta_box'    => array(
                    'title'       => 'Assigned To',
                    'field_title' => 'Select Deals',
                ),
            ),
            'to'   => array(
                'object_type' => 'post',
                'post_type'   => 'post',
                'meta_box'    => array(
                    'title'         => 'Managed By',
                    'context'       => 'side',
                    'empty_message' => 'No users',
                ),
            ),
        ) );
    } );

    2 questions:

    1. the object_type is set to user, but can I specify a user role instead of all users?
    2. if I want to connect CONTACTS with DEALS, then do I just change post_type="posts" to post_type="deals" on the TO side?
    #12594
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    1. The connection is available for all users. We do not have a way to control per user role yet.
    2. Yes, that's true. Just change the post type parameter.
    #12600
    @mindspark@mindspark
    Participant

    Anh -

    once I connect USERS to a POST, where will I see the Connect To and From info?

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