| @@ -1360,18 +1360,19 @@ | ||
| 1360 | 1360 | |
| 1361 | 1361 | if ( $this->attributes['section_betterdocs_archive_list_layout'] == 'layout-2' || $this->attributes['section_betterdocs_archive_list_layout'] == 'layout-3' ) { |
| 1362 | 1362 | $docs_list_title_tag = $this->attributes['list_title_tag_layout_2']; |
| 1363 | 1363 | |
| 1364 | - $term_params = [ | |
| 1365 | - 'current_category' => $term, | |
| 1366 | - 'term' => $term, | |
| 1367 | - 'orderby' => $orderby, | |
| 1368 | - 'order' => $this->attributes['order'], | |
| 1369 | - 'posts_per_page' => -1, | |
| 1370 | - 'archive_layout' => $this->attributes['section_betterdocs_archive_list_layout'], | |
| 1371 | - 'query_args' => betterdocs()->query->docs_query_args( $_docs_query ), | |
| 1372 | - 'docs_list_title_tag' => $docs_list_title_tag, | |
| 1373 | - ]; | |
| 1364 | + // Extend the base params rather than replacing them, so the nesting | |
| 1365 | + // keys built above (nested_subcategory, nested_terms_query, | |
| 1366 | + // nested_docs_query_args, list_icon_name, list_icon_url, layout_type) | |
| 1367 | + // survive for Layout 2/3 and their templates can render nested | |
| 1368 | + // subcategories the way Layout 1 does. Previously this branch | |
| 1369 | + // overwrote $term_params wholesale, dropping every nesting key. | |
| 1370 | + $term_params['current_category'] = $term; | |
| 1371 | + $term_params['orderby'] = $orderby; | |
| 1372 | + $term_params['order'] = $this->attributes['order']; | |
| 1373 | + $term_params['posts_per_page'] = -1; | |
| 1374 | + $term_params['docs_list_title_tag'] = $docs_list_title_tag; | |
| 1374 | 1375 | } |
| 1375 | 1376 | |
| 1376 | 1377 | if ( $this->attributes['enable_pagination'] ) { //pass page variable in query args if pagination is enabled |
| 1377 | 1378 | $page = get_query_var( 'paged' ) != '' ? get_query_var( 'paged' ) : 1; |