Skip to content

Instantly share code, notes, and snippets.

@rilwis
Created September 6, 2023 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rilwis/5bdf07c530206e5ab374f69cdbb5e7d0 to your computer and use it in GitHub Desktop.
Save rilwis/5bdf07c530206e5ab374f69cdbb5e7d0 to your computer and use it in GitHub Desktop.
MB Relationships: change field type
<?php
add_action( 'mb_relationships_init', function () {
MB_Relationships_API::register( [
'id' => 'users_to_posts',
'from' => [
'object_type' => 'user',
'field' => [
'field_type' => 'checkbox_list',
],
],
'to' => [
'object_type' => 'post',
'field' => [
'field_type' => 'radio',
],
],
] );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment