WordPress.org

Make WordPress Core

Opened 17 years ago

Closed 16 years ago

Last modified 15 years ago

#1186 closed enhancement (fixed)

New filter for list_cats() $exclusions variable

Reported by: Alex Parkhomenko Owned by: skippy
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)

template-functions-category.diff (427 bytes) - added by Alex Parkhomenko 17 years ago.

Download all attachments as: .zip

Change History (8)

#2 @Alex Parkhomenko
17 years ago

  • Patch set to No

#3 @skippy
16 years ago

  • Component changed from Template to General
  • Keywords bg|has-patch bg|dev-feedback added
  • Owner changed from anonymous to skippy
  • Status changed from new to assigned

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.

#4 @skippy
16 years ago

  • Milestone set to 1.5.2

#5 @matt
16 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [2780]) Fixes #967, Fixes #972, Fixes #1578, Fixes #1580, Fixes #1567, Fixes #1481, Fixes #1186

#6 @matt
16 years ago

  • Resolution set to fixed

(In [2831]) Fixes #1186 for 1.6

#7 @(none)
15 years ago

  • Milestone 1.5.2 deleted

Milestone 1.5.2 deleted

Note: See TracTickets for help on using tickets.