PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V3.3.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV3.3.2
V3.3.2 3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 All 139 releases
← All changes | includes/Core/Ajax/AjaxService.php +12 -7 2.0 → V3.3.2 View file →
@@ -6,14 +6,16 @@
6 6 use BitCode\BitForm\Core\Capability\Request;
7 7 use BitCode\BitForm\Core\Integration\Integrations;
8 8 use BitCode\BitForm\Frontend\Ajax\FrontendAjax;
9 9
10 -class AjaxService {
11 - public function __construct() {
10 +class AjaxService
11 +{
12 + public function __construct()
13 + {
12 14 if (Request::Check('ajax')) {
13 15 $this->loadPublicAjax();
14 16 }
15 - if (Request::Check('admin')) {
17 + if (Request::Check('admin') && (current_user_can('manage_bitform') || current_user_can('manage_options'))) {
16 18 $this->loadAdminAjax();
17 19 $this->loadIntegrationsAjax();
18 20 }
19 21 }
@@ -22,9 +24,10 @@
22 24 * Helps to register admin side ajax
23 25 *
24 26 * @return null
25 27 */
26 - public function loadAdminAjax() {
28 + public function loadAdminAjax()
29 + {
27 30 (new AdminAjax())->register();
28 31 }
29 32
30 33 /**
@@ -31,9 +34,10 @@
31 34 * Helps to register frontend ajax
32 35 *
33 36 * @return null
34 37 */
35 - protected function loadPublicAjax() {
38 + protected function loadPublicAjax()
39 + {
36 40 (new FrontendAjax())->register();
37 41 }
38 42
39 43 /**
@@ -40,8 +44,9 @@
40 44 * Helps to register integration ajax
41 45 *
42 46 * @return null
43 47 */
44 - public function loadIntegrationsAjax() {
45 - (new Integrations())->registerAjax();
48 + public function loadIntegrationsAjax()
49 + {
50 + (Integrations::getInstance())->registerAjax();
46 51 }
47 52 }