Jake Vanderwerf
2026-01-01 52733beffd7f1c48012b371d4ad8e7d937afd924
Merge branch 'main' of https://github.com/jakevdwerf/jvb
1 files modified
18 ■■■■ changed files
inc/rest/routes/FeedRoutes.php 18 ●●●● patch | view | raw | blame | history
inc/rest/routes/FeedRoutes.php
@@ -261,8 +261,23 @@
    protected function extractTaxonomies(array $fields, int $postID, string $content):array {
        $taxonomies = [];
        foreach ($fields as $key => $value) {
            if (array_key_exists($key, JVB_TAXONOMY) && (array_key_exists('public', JVB_TAXONOMY[$key]) && JVB_TAXONOMY[$key]['public']!== false)) {
            if (empty($value)) {
                continue;
            }
            if (!array_key_exists($key, JVB_TAXONOMY)) {
                continue;
            }
            $taxConfig = JVB_TAXONOMY[$key];
            if (isset($taxConfig['public']) && $taxConfig['public'] === false) {
                continue;
            }
                $terms = array_map('absint', explode(',',$value));
            $terms = array_filter($terms); // Remove 0 values
            if (empty($terms)) {
                continue;
            }
                foreach($terms as $termID) {
                    $term = get_term($termID, jvbCheckBase($key));
                    if ($term && !is_wp_error($term)) {
@@ -270,7 +285,6 @@
                    }
                }
            }
        }
        return $taxonomies;
    }