CMB2 / CMB2-Post-Search-field

Custom field for CMB2 which adds a post-search dialog for searching/attaching other post IDs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Main post repeated if post seach field is left blank

liblogger opened this issue · comments

(I'm not sure if this is the right place to raise this, as it may just be me missing something rather than a bug in the code - apologies if so!)

I'm using CMB2 and this code to create a one-to-many link between posts, with the post search field in a repeatable group, so that each connected post has some text to provide context to the connection. I've got this working okay - except if a post doesn't have any connected posts. If the field/group is left empty, my post/page template repeats the main post content in place of the expected connected post.

(I've tried using !empty and isset checks - they haven't worked, but again, that may be me missing something obvious)