$for) { if (array_intersect($for, $attributes['contentTypes'])) { $taxonomies[] = $tax; } } $settings = [ 'content' => $attributes['contentTypes'][0] ?? 'tattoo', 'contentTypes' => $attributes['contentTypes'], 'taxonomies' => $taxonomies, 'defaultOrder' => $attributes['defaultOrder'], 'itemsPerPage' => $attributes['itemsPerPage'], ]; $isGallery = false; if ($attributes['inheritQuery']) { $obj = get_queried_object(); $taxonomies = $contentTypes = []; if (is_singular()) { switch ($obj->post_type) { case BASE.'artist': case BASE.'partner': $contentTypes = jvbGetUserContentTypes(get_the_ID()); break; } if ($obj->post_type == BASE.'artist') { $isGallery = true; $context = 'artist'; $name = get_post_meta($obj->id, 'jvb_first_name', true); $feed_data['title'] = ($name== '') ? $obj->post_title : $name; } elseif ($obj->post_type == BASE.'partner') { $context = 'partner'; $feed_data['title'] = 'Offers:'; } $type = 'post'; } elseif (is_tax('jvb_shop')) { $context = 'shop'; $feed_data['title'] = 'At the Shop:'; $contentTypes = [ 'artist', 'tattoo', 'piercing', // 'event' ]; $type = 'term'; } elseif (is_tax()) { $context = str_replace(BASE, '', $obj->taxonomy); foreach ($jvb_taxonomy_for as $tax => $for) { if ($context === $tax) { $contentTypes = $for['types']; } } $type = 'term'; $context = 'taxonomy:'.$context; } jvbDump($settings); jvbDump($contentTypes); if (empty($contentTypes)) { return; } foreach ($contentTypes as $index => $type) { $contentTypes[$index] = str_replace(BASE, '', $type); } foreach ($jvb_taxonomy_for as $tax => $for) { if (array_intersect($for, $contentTypes)) { $taxonomies[] = $tax; } } $feed_data = [ 'content' => $contentTypes[0], 'contentTypes' => $contentTypes, 'taxonomies' => $taxonomies, 'context' => $context, ]; if ($isGallery) { $feed_data['isGallery'] = true; } $settings = array_merge($settings, $feed_data); $title = !array_key_exists('title', $settings) ? '' : '