#1186 closed enhancement (fixed)
New filter for list_cats() $exclusions variable
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 1.5.1 |
| Component: | General | Keywords: | bg|has-patch bg|dev-feedback |
| Focuses: | Cc: |
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.
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.