Skip to content

Commit

Permalink
fixes #1416
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Jun 27, 2017
1 parent a71252d commit 6ccf777
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions modules/css/class-kirki-output.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,20 @@ protected function parse_output() {
}

// No need to proceed this if the current value is the same as in the "exclude" value.
if ( isset( $output['exclude'] ) && false !== $output['exclude'] && is_array( $output['exclude'] ) ) {
if ( isset( $output['exclude'] ) && is_array( $output['exclude'] ) ) {
foreach ( $output['exclude'] as $exclude ) {
if ( is_array( $value ) && is_array( $exclude ) ) {
$diff1 = array_diff( $value, $exclude );
$diff2 = array_diff( $exclude, $value );
if ( is_array( $value ) ) {
if ( is_array( $exclude ) ) {
$diff1 = array_diff( $value, $exclude );
$diff2 = array_diff( $exclude, $value );

if ( empty( $diff1 ) && empty( $diff2 ) ) {
if ( empty( $diff1 ) && empty( $diff2 ) ) {
$skip = true;
}
}
// If 'choice' is defined check for sub-values too.
// Fixes https://github.com/aristath/kirki/issues/1416.
if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude === $value[ $output['choice'] ] ) {
$skip = true;
}
}
Expand Down

0 comments on commit 6ccf777

Please sign in to comment.