=== CatBranchNest ===
Contributors: janiko
Tags: categories, widget, hierarchy, sidebar
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A configurable hierarchical category widget with depth, counts, descendant counts, sorting and exclusions.

== Description ==

Category Nested Branches provides a native WP_Widget for category trees. Use it in classic widget sidebars or through the Legacy Widget block.

Configure the title, depth, content counts, descendant counts, empty-category visibility, sorting and excluded category IDs. Depth 0 shows all levels; 1 shows roots; 2 shows roots and children.

Rendering uses wp_list_categories(), canonical WordPress category links and native cat-item, current-cat, current-cat-parent and children classes. Sidebar wrappers come from the theme.

Counts follow native WordPress taxonomy rules for published content. Descendant counts include deeper levels even when those levels are hidden by the display depth. Each eligible content item is counted once per parent. Sorting by count uses direct category counts, not padded totals. Exclusions omit a category and its descendants; they do not change stored categories or relationships.

No JavaScript, theme dependency, custom SQL, telemetry, remote requests or generated content. Only normal widget settings are saved. Theme styles control the appearance.

All interface strings are translatable with the catbranchnest text domain.

== Installation ==

1. Upload the catbranchnest folder to wp-content/plugins, or upload its ZIP through Plugins > Add New.
2. Activate CatBranchNest.
3. Add Category Nested Branches to a sidebar through Appearance > Widgets (Legacy Widget in the block editor).
4. Configure and save the widget.

== Frequently Asked Questions ==

= Does this modify categories or posts? =
No. It reads the category hierarchy and stores only widget options.

= What does include subcategory content mean? =
Parent counters include published content assigned to descendant categories, using native WordPress padding. Hidden display levels still contribute.

= Why is a parent with a direct count of zero visible? =
Native hierarchical hide_empty keeps a parent when it has a non-empty descendant.

= Does sorting by count sort by the padded displayed total? =
No. Native category queries sort by the direct stored taxonomy count before padding.

= What happens when I exclude a parent? =
WordPress omits its entire branch. Exclusion is only a display setting.

= Does it work with any theme? =
It uses standard widget wrappers and category markup. The theme must provide a widget sidebar or Legacy Widget support. It supplies no frontend stylesheet.

== Screenshots ==

1. Widget settings in the WordPress administration area, including depth, category counts, sorting and exclusions.
2. Example hierarchical category list displayed in a theme sidebar.

== Changelog ==

= 0.1.0 =
* Initial version: native hierarchical category widget with configurable depth, counters, descendant counts, empty-category visibility, sorting and exclusions.
