Make WordPress Core


Ignore:
Timestamp:
12/18/2015 06:13:58 PM (9 years ago)
Author:
boonebgorges
Message:

Ensure that wp_list_categories() supports comma-separated lists for 'exclude' and 'exclude_tree'.

[34696] introduced a regression whereby comma-separated values for 'exclude'
and 'exclude_tree' would be handled improperly when merging the two parameters,
resulting in category IDs being incorrectly dropped from the combined array.

Merges [36005] to the 4.4 branch.

Props gblsm, hnle.
Fixes #35156.

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/src/wp-includes/category-template.php

    r35851 r36006  
    551551
    552552        if ( $r['exclude_tree'] ) {
    553             $exclude_tree = array_merge( $exclude_tree, (array) $r['exclude_tree'] );
     553            $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude_tree'] ) );
    554554        }
    555555
    556556        if ( $r['exclude'] ) {
    557             $exclude_tree = array_merge( $exclude_tree, (array) $r['exclude'] );
     557            $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude'] ) );
    558558        }
    559559
Note: See TracChangeset for help on using the changeset viewer.