Filter hook 'wp_mail'

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

View Source

wp_mail

Filter Hook
Description
Filters the wp_mail() arguments. }

Hook Information

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

Hook Parameters

Type Name Description
array $args { Array of the `wp_mail()` arguments.

Usage Examples

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

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

Source Code Context

wp-includes/pluggable.php:192 - How this hook is used in WordPress core
<?php
 187  		 *     @type string          $message     Message contents.
 188  		 *     @type string|string[] $headers     Additional headers.
 189  		 *     @type string|string[] $attachments Paths to files to attach.
 190  		 * }
 191  		 */
 192  		$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
 193  
 194  		/**
 195  		 * Filters whether to preempt sending an email.
 196  		 *
 197  		 * Returning a non-null value will short-circuit {@see wp_mail()}, returning

PHP Documentation

<?php
/**
		 * Filters the wp_mail() arguments.
		 *
		 * @since 2.2.0
		 *
		 * @param array $args {
		 *     Array of the `wp_mail()` arguments.
		 *
		 *     @type string|string[] $to          Array or comma-separated list of email addresses to send message.
		 *     @type string          $subject     Email subject.
		 *     @type string          $message     Message contents.
		 *     @type string|string[] $headers     Additional headers.
		 *     @type string|string[] $attachments Paths to files to attach.
		 * }
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.