Filter hook 'wp_mail_from'

in WP Core File wp-includes/pluggable.php at line 397

View Source

wp_mail_from

Filter Hook
Description
Filters the email address to send from.

Hook Information

File Location wp-includes/pluggable.php View on GitHub
Hook Type Filter
Line Number 397

Hook Parameters

Type Name Description
string $from_email Email address to send from.

Usage Examples

Basic Usage
<?php
// Hook into wp_mail_from
add_filter('wp_mail_from', 'my_custom_filter', 10, 1);

function my_custom_filter($from_email) {
    // Your custom filtering logic here
    return $from_email;
}

Source Code Context

wp-includes/pluggable.php:397 - How this hook is used in WordPress core
<?php
 392  		 *
 393  		 * @since 2.2.0
 394  		 *
 395  		 * @param string $from_email Email address to send from.
 396  		 */
 397  		$from_email = apply_filters( 'wp_mail_from', $from_email );
 398  
 399  		/**
 400  		 * Filters the name to associate with the "from" email address.
 401  		 *
 402  		 * @since 2.3.0

PHP Documentation

<?php
/**
		 * Filters the email address to send from.
		 *
		 * @since 2.2.0
		 *
		 * @param string $from_email Email address to send from.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.