From 2690b7ca8967efb8b229af57cf823f0917d980a0 Mon Sep 17 00:00:00 2001
From: hupe13 <73023225+hupe13@users.noreply.github.com>
Date: Tue, 27 Dec 2022 23:37:16 +0100
Subject: [PATCH] zoom validation #189 Part 2
---
class.plugin-option.php | 4 +++-
class.plugin-settings.php | 9 +++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/class.plugin-option.php b/class.plugin-option.php
index 0e180da..e9432dd 100644
--- a/class.plugin-option.php
+++ b/class.plugin-option.php
@@ -114,7 +114,9 @@ class="full-width"
?>
"
+ max="max) ? $this->max : ""; ?>"
+ step="step) ? $this->step : "any"; ?>"
name=""
type="type; ?>"
id=""
diff --git a/class.plugin-settings.php b/class.plugin-settings.php
index 0d17fd9..7af3aaf 100644
--- a/class.plugin-settings.php
+++ b/class.plugin-settings.php
@@ -101,6 +101,9 @@ private function __construct()
'display_name'=>__('Default Zoom', 'leaflet-map'),
'default'=>'12',
'type' => 'number',
+ 'min' => 0,
+ 'max' => 20,
+ 'step' => 1,
'helptext' => sprintf(
'%1$s %2$s
[leaflet-map zoom="5"]
',
__('Default zoom for maps.', 'leaflet-map'),
@@ -171,6 +174,9 @@ private function __construct()
'display_name'=>__('Default Min Zoom', 'leaflet-map'),
'default' => '0',
'type' => 'number',
+ 'min' => 0,
+ 'max' => 20,
+ 'step' => 1,
'helptext' => sprintf(
'%1$s %2$s
[leaflet-map min_zoom="1"]
',
__('Restrict the viewer from zooming in past the minimum zoom. Can set per map in shortcode or adjust for all maps here.', 'leaflet-map'),
@@ -181,6 +187,9 @@ private function __construct()
'display_name'=>__('Default Max Zoom', 'leaflet-map'),
'default' => '19',
'type' => 'number',
+ 'min' => 0,
+ 'max' => 20,
+ 'step' => 1,
'helptext' => sprintf(
'%1$s %2%s
%3$s
',
__('Restrict the viewer from zooming out past the maximum zoom. Can set per map in shortcode or adjust for all maps here', 'leaflet-map'),