Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
add_action( 'mb_relationships_init', function () {
MB_Relationships_API::register( array(
'id' => 'programs_to_updates',
'to' => 'projects',
'from' => 'updates',
) );
MB_Relationships_API::register( array(
'id' => 'users_to_posts',
'to' => array(
'object_type' => 'user',
'meta_box' => array(
'title' => 'Program access',
'field_title' => 'Select projects',
),
'field' => [
'query_args' => [
'number' => -1 // This
]
]
),
'from' => array(
'object_type' => 'post',
'post_type' => 'projects',
'meta_box' => array(
'title' => 'Clients with access',
'context' => 'side',
'empty_message' => 'No users',
),
),
) );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment