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:
- the object_type is set to user, but can I specify a user role instead of all users?
- if I want to connect CONTACTS with DEALS, then do I just change post_type="posts" to post_type="deals" on the TO side?