Skip to content

Commit

Permalink
fixes #1659
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Nov 23, 2017
1 parent 5d292d7 commit ba68084
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/class-kirki-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,17 @@ protected function set_output() {
if ( isset( $output['element'] ) && is_array( $output['element'] ) ) {
$this->output[ $key ]['element'] = array_unique( $this->output[ $key ]['element'] );
sort( $this->output[ $key ]['element'] );

// Trim each element in the array.
foreach ( $this->output[ $key ]['element'] as $index => $element ) {
$this->output[ $key ]['element'][ $index ] = trim( $element );
}
$this->output[ $key ]['element'] = implode( ',', $this->output[ $key ]['element'] );
}

// Fix for https://github.com/aristath/kirki/issues/1659#issuecomment-346229751
$this->output[ $key ]['element'] = str_replace( array( "\t", "\n", "\r", "\0", "\x0B" ), ' ', $this->output[ $key ]['element'] );
$this->output[ $key ]['element'] = trim( preg_replace('/\s+/', ' ', $this->output[ $key ]['element'] ) );
}
}

Expand Down

0 comments on commit ba68084

Please sign in to comment.