Hello Phil,
I think it is possible. You will need to register the relationship by code to use the select
field and some jQuery code to pre-select the dropdown value. For example:
Code to register the relationship:
MB_Relationships_API::register( [
'id' => 'tramp_detail_to_tramp_log',
'from' => [
'object_type' => 'post',
'post_type' => 'tramp-detail',
'field' => [
'field_type' => 'select',
]
],
'to' => [
'object_type' => 'post',
'post_type' => 'tramp-log',
'field' => [
'field_type' => 'select',
]
],
] );
jQuery code:
jQuery(document).ready(function($) {
//get the ID from the URL and assign it to "value"
$('#tramp_detail_to_tramp_log_to option[value=123]').attr('selected', 'selected');
});
you can change tramp_detail_to_tramp_log_to
to tramp_detail_to_tramp_log_from
depending on the relationship side.
Note: the code is for example. If you cannot complete the task, please contact an expert developer to help you in this case.