PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
← All changes | includes/emails/fields/class-charitable-email-fields-user.php +45 -13 1.6.7 → 1.8.13 View file →
@@ -2,17 +2,19 @@
2 2 /**
3 3 * Email Fields Donation class.
4 4 *
5 5 * @package Charitable/Classes/Charitable_Email_Fields_User
6 - * @author Eric Daams
7 - * @copyright Copyright (c) 2018, Studio 164a
6 + * @author David Bisset
7 + * @copyright Copyright (c) 2023, WP Charitable LLC
8 8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 9 * @since 1.5.0
10 - * @version 1.5.0
10 + * @version 1.8.0
11 11 */
12 12
13 13 // Exit if accessed directly.
14 -if ( ! defined( 'ABSPATH' ) ) { exit; }
14 +if ( ! defined( 'ABSPATH' ) ) {
15 + exit;
16 +}
15 17
16 18 if ( ! class_exists( 'Charitable_Email_Fields_User' ) ) :
17 19
18 20 /**
@@ -31,8 +33,35 @@
31 33 */
32 34 private $user;
33 35
34 36 /**
37 + * Email.
38 + *
39 + * @since 1.8.0
40 + *
41 + * @var string
42 + */
43 + public $email;
44 +
45 + /**
46 + * Preview.
47 + *
48 + * @since 1.8.0
49 + *
50 + * @var string
51 + */
52 + public $preview;
53 +
54 + /**
55 + * Fields.
56 + *
57 + * @since 1.8.0
58 + *
59 + * @var mixed
60 + */
61 + public $fields;
62 +
63 + /**
35 64 * Set up class instance.
36 65 *
37 66 * @since 1.5.0
38 67 *
@@ -54,17 +83,17 @@
54 83 * @return array
55 84 */
56 85 public function init_fields() {
57 86 $fields = array(
58 - 'user_login' => array(
87 + 'user_login' => array(
59 88 'description' => __( 'The user login', 'charitable' ),
60 89 'preview' => 'adam123',
61 90 ),
62 - 'first_name' => array(
91 + 'first_name' => array(
63 92 'description' => __( 'The user\'s first name', 'charitable' ),
64 93 'preview' => 'Adam',
65 94 ),
66 - 'last_name' => array(
95 + 'last_name' => array(
67 96 'description' => __( 'The user\'s last name', 'charitable' ),
68 97 'preview' => 'Jones',
69 98 ),
70 99 'display_name' => array(
@@ -73,14 +102,17 @@
73 102 ),
74 103 );
75 104
76 105 if ( $this->has_valid_user() ) {
77 - $fields = array_merge_recursive( $fields, array(
78 - 'user_login' => array( 'value' => $this->user->user_login ),
79 - 'first_name' => array( 'value' => $this->user->first_name ),
80 - 'last_name' => array( 'value' => $this->user->last_name ),
81 - 'display_name' => array( 'value' => $this->user->display_name ),
82 - ) );
106 + $fields = array_merge_recursive(
107 + $fields,
108 + array(
109 + 'user_login' => array( 'value' => $this->user->user_login ),
110 + 'first_name' => array( 'value' => $this->user->first_name ),
111 + 'last_name' => array( 'value' => $this->user->last_name ),
112 + 'display_name' => array( 'value' => $this->user->display_name ),
113 + )
114 + );
83 115 }
84 116
85 117 /**
86 118 * Filter the user email fields.