Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('site-reviews-filters/config/forms/filters-form', function (array $config): array
- {
- $plant_based_challenge_page_slug = 'plant-based-challenge';
- $plant_based_challenge_term_ids = [10355, 10356, 10373];
- if (empty($config['filter_by_term']['options'])) {
- return $config;
- }
- if ($plant_based_challenge_page_slug !== get_queried_object()?->post_name) {
- return $config;
- }
- $options = $config['filter_by_term']['options'];
- $config['filter_by_term']['options'] = array_filter(
- $options,
- static fn ($id) => in_array($id, ['', ...$plant_based_challenge_term_ids]),
- ARRAY_FILTER_USE_KEY
- );
- return $config;
- }, 15);
Advertisement
Add Comment
Please, Sign In to add comment