filtrod 5.7.0
pre_wp_mail
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
| Parametr | Typ | Opis |
|---|---|---|
$return | null | bool | Short-circuit return value. |
$atts | array | { 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
}
// 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