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