| Conditions | 7 |
| Paths | 5 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | protected function process_output( $output, $value ) { |
||
| 25 | |||
| 26 | $output = wp_parse_args( |
||
| 27 | $output, |
||
| 28 | array( |
||
| 29 | 'media_query' => 'global', |
||
| 30 | 'element' => 'body', |
||
| 31 | 'prefix' => '', |
||
| 32 | 'suffix' => '', |
||
| 33 | ) |
||
| 34 | ); |
||
| 35 | |||
| 36 | foreach ( array( 'background-image', 'background-color', 'background-repeat', 'background-position', 'background-size', 'background-attachment' ) as $property ) { |
||
| 37 | |||
| 38 | // See https://github.com/aristath/kirki/issues/1808. |
||
| 39 | if ( 'background-color' === $property && ( ! isset( $value['background-image'] ) || empty( $value['background-image'] ) ) ) { |
||
| 40 | $this->styles[ $output['media_query'] ][ $output['element'] ]['background'] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix']; |
||
|
|
|||
| 41 | } |
||
| 42 | |||
| 43 | if ( isset( $value[ $property ] ) && ! empty( $value[ $property ] ) ) { |
||
| 44 | $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix']; |
||
| 45 | } |
||
| 49 |