Custom Fields
Re-Envisioned
Support MB Relationships Warning on metabox for relationship to multiple CPTs

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 6 days, 16 hours ago.

  • Creator
    Topic
  • #16461

    Hi!
    I’m getting this:
    Warning: strtolower() expects parameter 1 to be string, array given in [...]/wp-includes/formatting.php on line 2126

    This happens when I register a relationship to multiple CPT’s and don’t hide the meta_box.

        MB_Relationships_API::register([
            'id' => 'xxxx',
            'from' => [
                'post_type' => 'cpt1',
                'meta_box' => [
                    'hidden'    => true,
                ]
            ],
            'to' => [
                'post_type' => ['cpt2','cpt3','cpt4','cpt5'],
                'meta_box' => [
                    'title' => 'xxxx',
                    'field_title' => 'xxxx',
                ],
            ],
        ]);
    

    The warning disappears when I add 'hidden' => true to the ‘to’ section, or when I use only one cpt in the second section.

    Any thoughts?

    Thanx!

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #16476

    Anh Tran
    Keymaster

    Hi,

    When creating relationship, please set the post_type parameter to a single post type. It doesn’t accept multiple post types.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.