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
formidable / paypal / controllers / FrmPayPalLiteFieldsController.php

FrmPayPalLiteFieldsController.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More trunk, at paypal/controllers/FrmPayPalLiteFieldsController.php

45 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 class FrmPayPalLiteFieldsController {
7
8 /**
9 * Hide the email, name, and address fields if they are marked as PayPal order fields.
10 *
11 * @since 6.31
12 *
13 * @param bool $show_normal_field_type Whether to show the field.
14 * @param string $type The field type.
15 * @param object $field The field object.
16 *
17 * @return bool
18 */
19 public static function hide_paypal_order_fields( $show_normal_field_type, $type, $field ) {
20 if ( ! in_array( $type, array( 'email', 'name', 'address' ), true ) ) {
21 return $show_normal_field_type;
22 }
23
24 $is_paypal_order_field = FrmField::get_option( $field, 'is_paypal_order_field' );
25
26 return $is_paypal_order_field ? false : $show_normal_field_type;
27 }
28
29 /**
30 * @param array $field The field settings.
31 * @param array $display The display settings for the field.
32 * @param array $values The values associated with the field.
33 */
34 public static function add_paypal_order_field_note( $field, $display, $values ) {
35 // Add a note about PayPal order fields here.
36 if ( ! FrmField::get_option( $field, 'is_paypal_order_field' ) ) {
37 return;
38 }
39
40 echo '<div class="frm_note_style">';
41 esc_html_e( 'This is a PayPal order field. It is automatically populated when a payment is processed, and is automatically excluded from the form HTML.', 'formidable' );
42 echo '</div>';
43 }
44 }
45