PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/fields/FrmFieldCreditCard.php +10 -9 6.5.2 → trunk View file →
@@ -10,8 +10,9 @@
10 10 class FrmFieldCreditCard extends FrmFieldType {
11 11
12 12 /**
13 13 * @var string
14 + *
14 15 * @since 3.0
15 16 */
16 17 protected $type = 'credit_card';
17 18
@@ -16,20 +17,23 @@
16 17 protected $type = 'credit_card';
17 18
18 19 /**
19 20 * @var bool
21 + *
20 22 * @since 3.0
21 23 */
22 24 protected $has_for_label = false;
23 25
26 + /**
27 + * @return array
28 + */
24 29 protected function field_settings_for_type() {
25 - $settings = array(
30 + return array(
26 31 'clear_on_focus' => false,
27 32 'description' => false,
28 33 'default' => false,
29 34 'required' => false,
30 35 );
31 - return $settings;
32 36 }
33 37
34 38 protected function include_form_builder_file() {
35 39 return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-credit-card.php';
@@ -37,8 +41,9 @@
37 41
38 42 /**
39 43 * @param array $args
40 44 * @param array $shortcode_atts
45 + *
41 46 * @return string
42 47 */
43 48 public function front_field_input( $args, $shortcode_atts ) {
44 49 $pass_args = array(
@@ -48,11 +53,10 @@
48 53 );
49 54
50 55 ob_start();
51 56
52 - if ( FrmAppHelper::is_style_editor_page() ) {
53 - // The styler preview doesn't load the Stripe scripts.
54 - // We need to use the form builder view instead.
57 + if ( FrmAppHelper::is_style_editor_page() || FrmFormsHelper::is_block_or_page_builder_preview() ) {
58 + // Payment gateway scripts are unavailable in preview contexts, use the builder placeholder.
55 59 $field = $this->field;
56 60 include $this->include_form_builder_file();
57 61 } else {
58 62 FrmStrpLiteActionsController::show_card( $this->field, $args['field_name'], $pass_args );
@@ -57,10 +61,7 @@
57 61 } else {
58 62 FrmStrpLiteActionsController::show_card( $this->field, $args['field_name'], $pass_args );
59 63 }
60 64
61 - $input_html = ob_get_contents();
62 - ob_end_clean();
63 -
64 - return $input_html;
65 + return ob_get_clean();
65 66 }
66 67 }