I reply to this thread of mine with a different issue for the same snippet. After several revisions of the code, it now works as expected, however PHP produces a warning which I would like to resolve.
The part in question is the following:
if (is_shop()) {
$output = flrt_selected_filter_terms();
foreach ($output as $value) {
$x = $value['values'][0];
$y = get_term_by('slug', $x, $value['e_name']);
$z = $y->name;
$new_breadcrumb = new bcn_breadcrumb($z, NULL, array('home'), get_site_url() . '/e-shop/' . $value['slug'] . '-' . $value['values'][0], NULL, true);
array_splice($breadcrumb_trail->breadcrumbs, -4, 0, array($new_breadcrumb));
}
}
It looks as when the bcn object is created, PHP complains:
PHP Warning: foreach() argument must be of type array|object, bool given