You appear to be a bot. Output may be restricted
Description
Get a recipient for a sent mock.
Usage
$bool|object = MockPHPMailer::get_recipient( $address_type, $mock_sent_index, $recipient_index );
Parameters
- $address_type
- ( string ) required – The type of address for the email such as to, cc or bcc.
- $mock_sent_index
- ( int ) optional – Optional. The sent_mock index we want to get the recipient for.
- $recipient_index
- ( int ) optional – Optional. The recipient index in the array.
Returns
bool|object Returns object on success, or false if any of the indices don't exist.
Source
File name: wordpress-develop-tests/phpunit/includes/mock-mailer.php
Lines:
1 to 17 of 17
public function get_recipient( $address_type, $mock_sent_index = 0, $recipient_index = 0 ) { $retval = false; $mock = $this->get_sent( $mock_sent_index ); if ( $mock ) { if ( isset( $mock->{$address_type}[ $recipient_index ] ) ) { $address_index = $mock->{$address_type}[ $recipient_index ]; $recipient_data = array( 'address' => ( isset( $address_index[0] ) && ! empty( $address_index[0] ) ) ? $address_index[0] : 'No address set', 'name' => ( isset( $address_index[1] ) && ! empty( $address_index[1] ) ) ? $address_index[1] : 'No name set', ); $retval = (object) $recipient_data; } } return $retval; }