Changeset 12353
- Timestamp:
- 03/06/2019 04:31:35 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-email-recipient.php
r10792 r12353 15 15 * @since 2.5.0 16 16 */ 17 class BP_Email_Recipient { 18 19 /** 20 * Recipient's email address. 21 * 22 * @since 2.5.0 23 * 24 * @var string 25 */ 26 protected $address = ''; 27 28 /** 29 * Recipient's name. 30 * 31 * @since 2.5.0 32 * 33 * @var string 34 */ 35 protected $name = ''; 17 class BP_Email_Recipient extends BP_Email_Participant { 36 18 37 19 /** … … 89 71 // Set address if we have one. 90 72 if ( ! empty( $address ) ) { 91 $this-> address = sanitize_email( $address);73 $this->set_address( sanitize_email( $address ) ); 92 74 } 93 75 … … 102 84 $wp_name = wp_specialchars_decode( bp_core_get_user_displayname( $this->user_object->ID ), ENT_QUOTES ); 103 85 104 $this-> address = $this->user_object->user_email;105 $this-> name = sanitize_text_field( $wp_name );86 $this->set_address( $this->user_object->user_email ); 87 $this->set_name( $wp_name ); 106 88 107 89 } … … 109 91 // Custom name override. 110 92 if ( $name ) { 111 $this-> name = $name;93 $this->set_name( $name ); 112 94 } 113 95 … … 133 115 */ 134 116 public function get_address() { 117 $address = parent::get_address(); 135 118 136 119 /** … … 139 122 * @since 2.5.0 140 123 * 141 * @param string $addressRecipient's address.142 * @param BP_Email $recipient $thisCurrent instance of the email recipient class.124 * @param string $address Recipient's address. 125 * @param BP_Email_Recipient $recipient Current instance of the email recipient class. 143 126 */ 144 return apply_filters( 'bp_email_recipient_get_address', $ this->address, $this );127 return apply_filters( 'bp_email_recipient_get_address', $address, $this ); 145 128 } 146 129 … … 153 136 */ 154 137 public function get_name() { 138 $name = parent::get_name(); 155 139 156 140 /** … … 159 143 * @since 2.5.0 160 144 * 161 * @param string $nameRecipient's name.162 * @param BP_Email $recipient $thisCurrent instance of the email recipient class.145 * @param string $name Recipient's name. 146 * @param BP_Email_Recipient $recipient Current instance of the email recipient class. 163 147 */ 164 return apply_filters( 'bp_email_recipient_get_name', $ this->name, $this );148 return apply_filters( 'bp_email_recipient_get_name', $name, $this ); 165 149 } 166 150 -
trunk/src/bp-core/classes/class-bp-email.php
r12284 r12353 66 66 * @since 2.5.0 67 67 * 68 * @var BP_Email_ RecipientSender details.68 * @var BP_Email_Sender Sender details. 69 69 */ 70 70 protected $from = null; … … 102 102 * @since 2.5.0 103 103 * 104 * @var BP_Email_ Recipient"Reply to" details.104 * @var BP_Email_Sender "Reply to" details. 105 105 */ 106 106 protected $reply_to = null; … … 431 431 * @param string $transform Optional. How to transform the return value. 432 432 * Accepts 'raw' (default) or 'replace-tokens'. 433 * @return BP_Email_ Recipient"From" recipient.433 * @return BP_Email_Sender "From" recipient. 434 434 */ 435 435 public function get_from( $transform = 'raw' ) { … … 739 739 */ 740 740 public function set_from( $email_address, $name = '' ) { 741 $from = new BP_Email_Recipient( $email_address, $name ); 741 $from = new BP_Email_Sender(); 742 743 $from->set_address( $email_address ); 744 $from->set_name( $name ); 742 745 743 746 /** … … 811 814 */ 812 815 public function set_reply_to( $email_address, $name = '' ) { 813 $reply_to = new BP_Email_Recipient( $email_address, $name ); 816 $reply_to = new BP_Email_Sender(); 817 818 $reply_to->set_address( $email_address ); 819 $reply_to->set_name( $name ); 814 820 815 821 /** -
trunk/src/class-buddypress.php
r12309 r12353 556 556 'BP_Date_Query' => 'core', 557 557 'BP_Email_Delivery' => 'core', 558 'BP_Email_Address' => 'core', 558 559 'BP_Email_Recipient' => 'core', 560 'BP_Email_Sender' => 'core', 561 'BP_Email_Participant' => 'core', 559 562 'BP_Email' => 'core', 560 563 'BP_Embed' => 'core',
Note: See TracChangeset
for help on using the changeset viewer.