WordPress at a glance
filter is not described

wp_mail filter-hook . WP 2.2.0

Filters the wp_mail() arguments.

Usage

add_filter( 'wp_mail', 'filter_function_name_8292' );
function filter_function_name_8292( $args ){
	// filter...

	return $args;
}
$args(array)

Array of the wp_mail() arguments.

  • to(string|string[])
    Array or comma-separated list of email addresses to send message.

  • subject(string)
    Email subject.

  • message(string)
    Message contents.

  • headers(string|string[])
    Additional headers.

  • attachments(string|string[])
    Paths to files to attach.

Changelog

Since 2.2.0 Introduced.

Where the hook is called

wp_mail()
wp_mail
wp-includes/pluggable.php 189
$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );

Where in WP core the hook is used WordPress

wp-includes/default-filters.php 237
add_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );