Opened 10 years ago
Closed 10 years ago
#31681 closed defect (bug) (fixed)
Filter `list_terms_exclusions` passes empty array instead of empty string
Reported by: | fhwebcs | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | minor | Version: | 4.2 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
In some cases apply_filters( 'list_terms_exclusions', $exclusions, ... )
will pass an empty array via $exclusions
instead of an (empty) string as documented.
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/taxonomy.php#L1838
Location: taxononmy.php, line 1836:
$exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $args, $taxonomies );
Fix should be about 10 lines before (line 1823):
if ( ! empty( $exclusions ) ) {
$exclusions = ' AND t.term_id NOT IN (' . implode( ',', array_map( 'intval', $exclusions ) ) . ')';
} else {
$exclusions = '';
}
This is my first bug report, so let me know if I have missed anything ;-).
Change History (2)
Note: See
TracTickets for help on using
tickets.
Thank you for the report!