mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-20 11:14:28 +00:00
External Libraries: Skip deprecated file warning for PHPMailer if the API is not loaded.
In [48033] the "class-phpmailer.php" file was deprecated. In test suites, this file is loaded before WordPress in order to setup a mock PHPMailer instance. This means that for test suites that are still loading that file, they'll experience fatal errors due to the undefined "_deprecated_file" function. This commit skips issuing the deprecated file warning if the "_deprecated_file" function is not available. Fixes #50380. git-svn-id: https://develop.svn.wordpress.org/trunk@48034 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
/**
|
||||
* The PHPMailer class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.
|
||||
*/
|
||||
_deprecated_file( basename( __FILE__ ), '5.5.0', WPINC . '/PHPMailer/PHPMailer.php', __( 'The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' ) );
|
||||
if ( function_exists( '_deprecated_file' ) ) {
|
||||
_deprecated_file( basename( __FILE__ ), '5.5.0', WPINC . '/PHPMailer/PHPMailer.php', __( 'The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' ) );
|
||||
}
|
||||
require __DIR__ . '/PHPMailer/PHPMailer.php';
|
||||
|
||||
class_alias( PHPMailer\PHPMailer\PHPMailer::class, 'PHPMailer' );
|
||||
|
||||
Reference in New Issue
Block a user