PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.21
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.21
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
formidable / classes / models / fields / FrmFieldCreditCard.php

FrmFieldCreditCard.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.21, at classes/models/fields/FrmFieldCreditCard.php

67 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 die( 'You are not allowed to call this page directly.' );
5 }
6
7 /**
8 * @since 3.0
9 */
10 class FrmFieldCreditCard extends FrmFieldType {
11
12 /**
13 * @var string
14 * @since 3.0
15 */
16 protected $type = 'credit_card';
17
18 /**
19 * @var bool
20 * @since 3.0
21 */
22 protected $has_for_label = false;
23
24 protected function field_settings_for_type() {
25 $settings = array(
26 'clear_on_focus' => false,
27 'description' => false,
28 'default' => false,
29 'required' => false,
30 );
31 return $settings;
32 }
33
34 protected function include_form_builder_file() {
35 return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-credit-card.php';
36 }
37
38 /**
39 * @param array $args
40 * @param array $shortcode_atts
41 * @return string
42 */
43 public function front_field_input( $args, $shortcode_atts ) {
44 $pass_args = array(
45 'errors' => $args['errors'],
46 'html_id' => $args['html_id'],
47 'field_id' => $args['field_id'],
48 );
49
50 ob_start();
51
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.
55 $field = $this->field;
56 include $this->include_form_builder_file();
57 } else {
58 FrmStrpLiteActionsController::show_card( $this->field, $args['field_name'], $pass_args );
59 }
60
61 $input_html = ob_get_contents();
62 ob_end_clean();
63
64 return $input_html;
65 }
66 }
67