src/includes/mock-mailer.php
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;
	}
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;
	}
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 ; }
Get a recipient for a sent mock.

@since 4.5.0

@param string $address_type    The type of address for the email such as to, cc or bcc.
@param int    $mock_sent_index Optional. The sent_mock index we want to get the recipient for.
@param int    $recipient_index Optional. The recipient index in the array.
@return bool|object Returns object on success, or false if any of the indices don't exist.
Get a recipient for a sent mock .