base.php
3 months ago
border.php
3 months ago
dimensions.php
3 months ago
range.php
3 months ago
typography.php
3 months ago
range.php
29 lines
| 1 | <?php |
| 2 | namespace Crocoblock\Blocks_Style\Field_Handlers; |
| 3 | |
| 4 | class Range extends Base { |
| 5 | |
| 6 | /** |
| 7 | * Get the parsed value. |
| 8 | * |
| 9 | * @return array |
| 10 | */ |
| 11 | public function get_parsed_value() { |
| 12 | |
| 13 | if ( is_array( $this->raw_value ) |
| 14 | && isset( $this->raw_value['value'] ) |
| 15 | && isset( $this->raw_value['unit'] ) |
| 16 | ) { |
| 17 | return array( |
| 18 | 'value' => ! empty( $this->raw_value['value'] ) ? esc_attr( $this->raw_value['value'] ) : 0, |
| 19 | 'unit' => esc_attr( $this->raw_value['unit'] ), |
| 20 | ); |
| 21 | } |
| 22 | |
| 23 | return array( |
| 24 | 'value' => ! empty( $this->raw_value ) ? esc_attr( $this->raw_value ) : 0, |
| 25 | 'unit' => '', |
| 26 | ); |
| 27 | } |
| 28 | } |
| 29 |