Hello,
You can use the code to make the field in the relationship box mandatory. Here is an example:
function your_prefix_function_name() {
MB_Relationships_API::register( [
'id' => 'post-to-product',
'from' => [
'object_type' => 'post',
'post_type' => 'post',
'field' => [
'required' => true //here
],
],
'to' => [
'object_type' => 'post',
'post_type' => 'product',
'field' => [
'required' => true //here
],
],
] );
}
Following the documentation https://docs.metabox.io/extensions/mb-relationships/#using-code