← All changes
|
includes/Frontend/Form/View/Theme/Fields/RecaptchaV2Field.php
+5
-3
3.1.4
→
V3.3.2
View file →
| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace BitCode\BitForm\Frontend\Form\View\Theme\Fields; |
| 4 | 4 | |
| 5 | 5 | use BitCode\BitForm\Core\Integration\IntegrationHandler; |
| 6 | +use BitCode\BitForm\Core\Util\Utilities; | |
| 6 | 7 | |
| 7 | 8 | class RecaptchaV2Field |
| 8 | 9 | { |
| 9 | 10 | public static function init($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error = null, $value = null) |
| @@ -12,9 +13,10 @@ | ||
| 12 | 13 | $allFormIntegrations = $integrationHandler->getAllIntegration('app', 'gReCaptcha'); |
| 13 | 14 | if (is_wp_error($allFormIntegrations)) { |
| 14 | 15 | return ''; |
| 15 | 16 | } |
| 16 | - $siteKey = json_decode($allFormIntegrations[0]->integration_details)->siteKey; | |
| 17 | + $row = Utilities::firstRow($allFormIntegrations); | |
| 18 | + $siteKey = Utilities::jsonObj($row->integration_details ?? '')->siteKey ?? ''; | |
| 17 | 19 | return self::field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $siteKey, $error = null, $value = null); |
| 18 | 20 | } |
| 19 | 21 | |
| 20 | 22 | private static function field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $siteKey, $error = null, $value = null) |
| @@ -41,10 +43,10 @@ | ||
| 41 | 43 | $fieldHelpers->getCustomAttributes('fld-wrp'), |
| 42 | 44 | $fieldHelpers->getAtomicCls('fld-wrp'), |
| 43 | 45 | $fieldHelpers->getCustomClasses('fld-wrp'), |
| 44 | 46 | $rowID, |
| 45 | - $theme, | |
| 46 | - $size, | |
| 47 | + $fieldHelpers->esc_attr($theme), | |
| 48 | + $fieldHelpers->esc_attr($size), | |
| 47 | 49 | $fieldHelpers->esc_attr($siteKey) |
| 48 | 50 | ); |
| 49 | 51 | } |
| 50 | 52 | } |