WP HOOKS
filtrod 5.7.0

pre_wp_mail

Args 2Plik wp-includes/pluggable.phpDokumentacja WP ↗

Opis — z kodu źródłowego

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 whether the email was successfully sent.

Parametry

ParametrTypOpis
$returnnull | boolShort-circuit return value.
$attsarray{ Array of the <code>wp_mail()</code> 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. }

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_wp_mail', 'twoja_funkcja', 10, 2 );

function twoja_funkcja($param_1, $param_2) {
	// Twój kod
}

Popularne w tej kategorii