#1186 closed enhancement (fixed)
New filter for list_cats() $exclusions variable
| Reported by: | Alex Parkhomenko | Owned by: | skippy |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 1.5.1 |
| Severity: | normal | Keywords: | bg|has-patch bg|dev-feedback |
| Cc: | Focuses: |
Description
Could we add a new filter to give plugins more control of categories selections from database without modifying a template?
Would be useful in multiauthor views and category detections by browser-requested language.
Attachments (1)
Change History (8)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This patch looks to add a filter right after this bit:
$exclusions = ''; if (!empty($exclude)) { $excats = preg_split('/[\s,]+/',$exclude); if (count($excats)) { foreach ($excats as $excat) { $exclusions .= ' AND cat_ID <> ' . intval($excat) . ' '; } } }in order to adjust which categories get exluded. Such a filter could conceivably prepare a complex exclusion list (exclude all categories owned by users X and Z but not Y).
Adding filter and action hooks is cheap.