apply_filters( 'wp_mail', array $args )
- Since
- 2.2.0, 6.9.0
Filters the wp_mail() arguments.
Compatibility
- WordPress
- since 6.9.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$argsarray- { 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.
@type string|string[] $embeds Paths to files to embed.
}$tostring|string[]Array or comma-separated list of email addresses to send message.$subjectstringEmail subject.$messagestringMessage contents.$headersstring|string[]Additional headers.$attachmentsstring|string[]Paths to files to attach.$embedsstring|string[]Paths to files to embed.
Where this hook fires · 1
wp-includes/pluggable.php:209wp_mail()
Source code
* @type string $message Message contents. * @type string|string[] $headers Additional headers. * @type string|string[] $attachments Paths to files to attach. * @type string|string[] $embeds Paths to files to embed. * } */ $atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments', 'embeds' ) ); /** * Filters whether to preempt sending an email. * * Returning a non-null value will short-circuit {@see wp_mail()}, returning * that value instead. A boolean return value should be used to indicate whetherChangelog
Introduced in 2.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
6.9.0
The
$embeds element was added to the $args array.from the docblock2.2.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.