| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
namespace JFB_Modules\Block_Parsers\Fields; |
| 5 |
|
| 6 |
use JFB_Modules\Block_Parsers\Field_Data_Parser; |
| 7 |
|
| 8 |
// If this file is called directly, abort. |
| 9 |
if ( ! defined( 'WPINC' ) ) { |
| 10 |
die; |
| 11 |
} |
| 12 |
|
| 13 |
class Default_Parser extends Field_Data_Parser { |
| 14 |
|
| 15 |
public function type() { |
| 16 |
return 'default'; |
| 17 |
} |
| 18 |
|
| 19 |
protected function allows_array_value(): bool { |
| 20 |
switch ( $this->get_type() ) { |
| 21 |
case 'checkbox-field': |
| 22 |
return true; |
| 23 |
case 'select-field': |
| 24 |
return (bool) $this->get_setting( 'multiple' ); |
| 25 |
default: |
| 26 |
return false; |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
} |
| 31 |
|