GlobalStyleRequest.php
1 week ago
PageDataRequest.php
1 week ago
PageRequest.php
1 week ago
PageSettingsRequest.php
1 week ago
PageUpdateRequest.php
1 week ago
PopupRequest.php
1 week ago
RenameStagingVersionRequest.php
1 week ago
StagingVersionRequest.php
1 week ago
TogglePageSymbolRequest.php
1 month ago
PopupRequest.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Kirki\App\Http\Requests\Page; |
| 4 | |
| 5 | defined('ABSPATH') || exit; |
| 6 | |
| 7 | use Kirki\Framework\Http\Request; |
| 8 | use Kirki\Framework\Sanitizer; |
| 9 | |
| 10 | use function Kirki\App\ensure_array; |
| 11 | |
| 12 | class PopupRequest extends Request |
| 13 | { |
| 14 | protected function prepare_for_validation() |
| 15 | { |
| 16 | $this->merge([ |
| 17 | 'blocks' => ensure_array($this->blocks), |
| 18 | 'styleBlocks' => ensure_array($this->styleBlocks), |
| 19 | 'usedFonts' => ensure_array($this->usedFonts), |
| 20 | ]); |
| 21 | } |
| 22 | |
| 23 | public function rules() |
| 24 | { |
| 25 | return [ |
| 26 | 'blocks' => 'nullable|array', |
| 27 | 'styleBlocks' => 'nullable|array', |
| 28 | 'usedFonts' => 'nullable|array', |
| 29 | ]; |
| 30 | } |
| 31 | |
| 32 | public function filters() |
| 33 | { |
| 34 | return [ |
| 35 | 'blocks' => Sanitizer::ARRAY, |
| 36 | 'styleBlocks' => Sanitizer::ARRAY, |
| 37 | 'usedFonts' => Sanitizer::ARRAY, |
| 38 | ]; |
| 39 | } |
| 40 | } |