Relationship box won't show up below costom fields
Support › MB Relationships › Relationship box won't show up below costom fieldsResolved
- This topic has 4 replies, 2 voices, and was last updated 3 years, 2 months ago by
Long Nguyen.
-
AuthorPosts
-
January 30, 2022 at 1:58 AM #33568
danieldk
ParticipantI have a relationship defined that works as I want, except it shows up below the custom fields on one side of the relationship, but not on the other side.
I have tried to put the
context = normal
in different places, and it just doesn't move away from the sidebar.add_action('mb_relationships_init', function () { MB_Relationships_API::register([ 'id' => 'djs_to_events', 'from' => array( 'post_type' => 'tmd_dj', 'admin_columns' => array( 'position' => 'after title', 'title' => 'Events', ), 'empty_message' => 'No DJs connected', 'context' => 'normal', 'meta_box' => array( 'id' => 'event_selection', 'name' => 'Events', 'title' => 'Events this DJ played at', 'context' => 'normal', 'class' => 'event_selection', ), 'field' => array( 'context' => 'advanced', 'name' => 'DJs playing in this event', 'label_description' => '', 'placeholder' => 'Select DJs', 'add_button' => 'Add another Event', ), ), 'to' => array( 'post_type' => 'tmd_event', 'empty_message' => 'No events connected', 'admin_columns' => array( 'position' => 'after title', 'title' => 'DJs', ), 'context' => 'advanced', 'meta_box' => array( 'id' => 'dj_selection', 'name' => 'DJs', 'title' => 'Select DJs', 'context' => 'advanced', 'class' => 'dj_selection', ), 'field' => array( 'context' => 'advanced', 'name' => 'This DJs played at the linked events', 'label_description' => '', 'desc' => 'Not all events are usually linked, but we try our best.', 'add_button' => 'Link with another event', ), ), ]); });
February 2, 2022 at 9:17 AM #33604Long Nguyen
ModeratorHi,
The setting
context
of meta box works as well on my site, here is the screenshot https://monosnap.com/file/8SU74JQCpxclzDMPqWSHJfHg9mZ8YGCode:
function your_prefix_function_name() { MB_Relationships_API::register( [ 'id' => 'job-to-post', 'from' => 'job', 'to' => [ 'object_type' => 'post', 'post_type' => 'post', 'meta_box' => [ 'context' => 'normal', ], ], ] ); }
February 3, 2022 at 2:36 AM #33630danieldk
ParticipantHere's my minimal definition of the relationship.
Moving the metabox into the main column works only on the FROM side, but not on the TO side.
Is that the intention, or a bug?add_action('mb_relationships_init', function () { MB_Relationships_API::register([ 'id' => 'djs_to_events', 'from' => array( 'post_type' => 'tmd_dj', 'meta_box' => array( 'context' => 'normal', ), ), 'to' => array( 'post_type' => 'tmd_event', 'meta_box' => array( 'context' => 'normal', ), ), ]); });
February 3, 2022 at 2:50 AM #33631danieldk
ParticipantHa! I am getting closer: looks like there is user meta data that was stored in my database about the location of metaboxes.
Is there a way to delete these settings using metabox AIO?
February 6, 2022 at 11:04 PM #33684Long Nguyen
ModeratorHi,
No, it is not possible to change the meta box location (order) of user data with MB AIO. You can drag and drop the meta box relationship to re-order it and save the post to update the user data.
Tip: use Classic Editor for drag and drop meta boxes easier https://wordpress.org/plugins/classic-editor/
-
AuthorPosts
- You must be logged in to reply to this topic.