sitecrafting / conifer

:evergreen_tree: A powerful WordPress library plugin for OO development
https://www.coniferplug.in
MIT License
18 stars 2 forks source link

Issue with filtering post results from get_all_grouped_by_term() #148

Open rbhensley opened 2 years ago

rbhensley commented 2 years ago

https://www.coniferplug.in/posts.html#filtering-the-posts-in-each-group

Expected to get all posts grouped by the TAX_RECGROUP taxonomy and filter down the results in each group to a different taxonomy. What I got was each TAX_RECGROUP had all posts from the TAX_RECCAT, 2 groups of the same posts

$recs = Recommendation::get_all_grouped_by_term(
    Recommendation::TAX_RECGROUP,
    [],
    [
        'posts_per_page' => -1,
        'tax_query' => [
            [
                'taxonomy' => Recommendation::TAX_RECCAT,
                'field'    => 'term_id',
                'terms'    => [ $term->ID ]
            ],
        ]
    ]
);

Conifer Version 0.9.0 Timber Version 1.19.1