← All changes
|
includes/emails/fields/class-charitable-email-fields-user.php
+42
-12
1.6.60
→
1.8.13
View file →
| @@ -2,13 +2,13 @@ | ||
| 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) 2022, 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 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -33,8 +33,35 @@ | ||
| 33 | 33 | */ |
| 34 | 34 | private $user; |
| 35 | 35 | |
| 36 | 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 | + /** | |
| 37 | 64 | * Set up class instance. |
| 38 | 65 | * |
| 39 | 66 | * @since 1.5.0 |
| 40 | 67 | * |
| @@ -56,17 +83,17 @@ | ||
| 56 | 83 | * @return array |
| 57 | 84 | */ |
| 58 | 85 | public function init_fields() { |
| 59 | 86 | $fields = array( |
| 60 | - 'user_login' => array( | |
| 87 | + 'user_login' => array( | |
| 61 | 88 | 'description' => __( 'The user login', 'charitable' ), |
| 62 | 89 | 'preview' => 'adam123', |
| 63 | 90 | ), |
| 64 | - 'first_name' => array( | |
| 91 | + 'first_name' => array( | |
| 65 | 92 | 'description' => __( 'The user\'s first name', 'charitable' ), |
| 66 | 93 | 'preview' => 'Adam', |
| 67 | 94 | ), |
| 68 | - 'last_name' => array( | |
| 95 | + 'last_name' => array( | |
| 69 | 96 | 'description' => __( 'The user\'s last name', 'charitable' ), |
| 70 | 97 | 'preview' => 'Jones', |
| 71 | 98 | ), |
| 72 | 99 | 'display_name' => array( |
| @@ -75,14 +102,17 @@ | ||
| 75 | 102 | ), |
| 76 | 103 | ); |
| 77 | 104 | |
| 78 | 105 | if ( $this->has_valid_user() ) { |
| 79 | - $fields = array_merge_recursive( $fields, array( | |
| 80 | - 'user_login' => array( 'value' => $this->user->user_login ), | |
| 81 | - 'first_name' => array( 'value' => $this->user->first_name ), | |
| 82 | - 'last_name' => array( 'value' => $this->user->last_name ), | |
| 83 | - 'display_name' => array( 'value' => $this->user->display_name ), | |
| 84 | - ) ); | |
| 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 | + ); | |
| 85 | 115 | } |
| 86 | 116 | |
| 87 | 117 | /** |
| 88 | 118 | * Filter the user email fields. |