public function saveDrawPoints()
    {
        if (!isset($_POST['coordinates']) && !empty($_POST['coordinates'])) {
            wp_send_json_error("Missing coordinates");
        }

        $points = $_POST['coordinates'];
        // Convert coordinates to float
        foreach ($points as &$point) {
            $point = array_map('floatval', $point);
        }
        update_option('event_import_area', $points);
        wp_send_json_success($points);
    }
public function saveDrawPoints()
    {
        if (!isset($_POST['coordinates']) && !empty($_POST['coordinates'])) {
            wp_send_json_error("Missing coordinates");
        }

        $points = $_POST['coordinates'];
        // Convert coordinates to float
        foreach ($points as &$point) {
            $point = array_map('floatval', $point);
        }
        update_option('event_import_area', $points);
        wp_send_json_success($points);
    }
public function saveDrawPoints ( ) { if ( ! isset ( $ _POST [ 'coordinates' ] ) && ! empty ( $ _POST [ 'coordinates' ] ) ) { wp_send_json_error ( "Missing coordinates" ) ; } $ points = $ _POST [ 'coordinates' ] ; // Convert coordinates to float foreach ( $ points as & $ point ) { $ point = array_map ( 'floatval' , $ point ) ; } update_option ( 'event_import_area' , $ points ) ; wp_send_json_success ( $ points ) ; }
Save area coordinates as option
Save area coordinates as option