Custom Fields
Support MB Relationships One-to-many relationship on “bay_mb_relationships”

  • Creator
  • #18052
    Resolved Berg Informatik

    I try to realize a database structure like this.

    I have 3 post types:
    * Workout
    * Exercise
    * Set

    Thanks to the many-to-many plugin i can connect the Workout and Exercise with ease. But how can i connect the Set’s with one-to-many relation to the “bay_mb_relationships” junction table.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #18072
    Anh Tran


    If you want to force only one connection from one side of a relationship, please set 'max_clone' => 1 to the field on that side, like this:

    add_action( 'mb_relationships_init', function () {
                'id'   => 'workout_to_workout_exercises',
                'from' => array(
                    'object_type' => 'post',
                    'post_type' => 'workout',
                    'field' => array(
                        'max_clone' => 1, // Limit to 1 connection only.
                'to'   => array(
                    'object_type' => 'post',
                    'post_type' => 'workout_exercises',
    } );
    Berg Informatik

    Thanks for the tip. I just got to know the plugin. This plugin is very helpful for creating web applications with WordPress. A small minus is the missing attribute “Required” for some file types like “Map”, “Autocomplete”, “Color Picker” and “Advanced Image”. Anyway, i think i will love the plugin more and more the deeper i dive into programming.

    Anh Tran

    Thank you for your kind words and your feedback. We keep improving the plugin and will try our best to make it more useful for you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.


Subscribe to our newsletter to receive news and tutorials for Meta Box and WordPress.

grid gear info copy caret-up caret-down trash