When searching for multiple relationships with WP_Query, no error occurs if at least one search result exists.
However, if the search result does not exist, the following error occurs:
Warning: array_unique() expects parameter 1 to be array, null given in /var/www/html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-relationships/inc/query/query.php on line 193
Warning: implode(): Invalid arguments passed in /var/www/html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-relationships/inc/query/query.php on line 194
Temporarily, I'm preventing the error by adding the following code to the end of the function:
if (empty($merge_object_ids)) {
$merge_object_ids = '-1';
} else {
$merge_object_ids = array_unique( $merge_object_ids );
$merge_object_ids = implode( ',', $merge_object_ids );
}