Custom taxonomy not saving to localized content file

Hi,

I've added an input to save a custom taxonomy on a collection type. I'm using it to filter news posts in a custom addon I've created and it works fine for the standard pages, but the data isn't saving to the localized posts which means I can't filter the posts when users are looking at the localized version of the site. I've tried making the news category input localizable, but it's still not saving to the localized version of the post.

The input in the news.yaml file:

news-cat:
    display: News Category
    type: taxonomy
    taxonomy: news-category

The custom filter:

class BlogPostsFilter extends Filter
{
    /**
     * Perform filtering on a collection
     *
     * @return \Illuminate\Support\Collection
     */
    public function filter($collection)
    {
        return $collection->filter(function ($entry) {
            if (!empty($entry->get('news-cat'))) {
                return in_array($this->get('cat_type'), $entry->get('news-cat'));
            }
        })->slice(0, $this->get('num_posts'));
    }
}
>>>>>>> Unanswered <<<<<<<
12 Replies
2 Followers