AdminGeneralOptionsGet.php
3 months ago
AdminGeneralOptionsPersist.php
3 months ago
CustomFieldKeys.php
3 months ago
EditorMenuFavorites.php
3 months ago
EditorMenuStatus.php
3 months ago
ExtendedValue.php
3 months ago
IntegrationToggle.php
3 months ago
Integrations.php
3 months ago
ListScreenAddColumn.php
3 months ago
ListScreenDelete.php
3 months ago
ListScreenOriginalColumns.php
3 months ago
ListScreenSave.php
3 months ago
ListScreenSelectColumn.php
3 months ago
ListScreenSettings.php
3 months ago
NetworkPostStati.php
3 months ago
NumberFormat.php
3 months ago
RestoreSettingsRequest.php
3 months ago
ScreenOptions.php
3 months ago
NumberFormat.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\RequestHandler\Ajax; |
| 4 | |
| 5 | use AC\Request; |
| 6 | use AC\RequestAjaxHandler; |
| 7 | |
| 8 | final class NumberFormat implements RequestAjaxHandler |
| 9 | { |
| 10 | |
| 11 | public function handle(): void |
| 12 | { |
| 13 | $request = new Request(); |
| 14 | |
| 15 | $number = $request->get('number') ?: 7500; |
| 16 | $decimals = $request->get('decimals') ?: null; |
| 17 | $decimal_separator = $request->get('decimal_point') ?: null; |
| 18 | $thousands_separator = $request->get('thousands_sep') ?: ''; |
| 19 | |
| 20 | wp_send_json_success( |
| 21 | number_format($number, $decimals, $decimal_separator, $thousands_separator) |
| 22 | ); |
| 23 | } |
| 24 | |
| 25 | } |