HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/local/wp/vendor/wp-cli/wp-cli-tests/utils/no-mail.php
<?php
/**
 * This file is copied as a mu-plugin into new WP installs to reroute normal
 * mails into log entries.
 */

/**
 * Replace WP native pluggable wp_mail function for test purposes.
 *
 * @param string|string[] $to Array or comma-separated list of email addresses to send message.
 * @return bool Whether the email was sent successfully.
 *
 * @phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- WP native function.
 */
function wp_mail( $to ) {
	if ( is_array( $to ) ) {
		$to = join( ', ', $to );
	}

	// Log for testing purposes
	WP_CLI::log( "WP-CLI test suite: Sent email to {$to}." );

	// Assume sending mail always succeeds.
	return true;
}
// phpcs:enable