[wp-trac] [WordPress Trac] #31681: Filter `list_terms_exclusions` passes empty array instead of empty string

WordPress Trac noreply at wordpress.org
Wed Mar 18 10:39:04 UTC 2015


#31681: Filter `list_terms_exclusions` passes empty array instead of empty string
--------------------------+-----------------------------
 Reporter:  fhwebcs       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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:
 {{{#!php
 $exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $args,
 $taxonomies );
 }}}

 Fix should be about 10 lines before (line 1823):
 {{{#!php
 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 ;-).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31681>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list