| @@ -2,8 +2,10 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace SimpleAnalytics\Settings\Blocks\Fields; |
| 4 | 4 | |
| 5 | 5 | use SimpleAnalytics\Setting; |
| 6 | +use SimpleAnalytics\SettingName; | |
| 7 | +use SimpleAnalytics\Support\OnloadCallback; | |
| 6 | 8 | use SimpleAnalytics\Settings\Concerns\HasDocs; |
| 7 | 9 | use SimpleAnalytics\Settings\Concerns\HasPlaceholder; |
| 8 | 10 | use SimpleAnalytics\UI\LabelComponent; |
| 9 | 11 | |
| @@ -28,8 +30,11 @@ | ||
| 28 | 30 | protected $placeholder; |
| 29 | 31 | |
| 30 | 32 | public function getValueSanitizer(): callable |
| 31 | 33 | { |
| 34 | + if ($this->getKey() === SettingName::ONLOAD_CALLBACK) { | |
| 35 | + return [OnloadCallback::class, 'sanitize']; | |
| 36 | + } | |
| 32 | 37 | return 'sanitize_text_field'; |
| 33 | 38 | } |
| 34 | 39 | |
| 35 | 40 | public function getValueType(): string |