pre_wp_mail хук-фильтр . WP 5.7.0
Filters whether to preempt sending an email.
Returning a non-null value will short-circuit wp_mail(), returning that value instead. A boolean return value should be used to indicate whether the email was successfully sent.
Использование
add_filter( 'pre_wp_mail', 'filter_function_name_1959', 10, 2 ); function filter_function_name_1959( $return, $atts ){ // filter... return $return; }
- $return(null/true|false)
- Short-circuit return value.
- $atts(массив)
Array of the wp_mail() arguments.
-
to(строка/строка[])
Array or comma-separated list of email addresses to send message. -
subject(строка)
Email subject. -
message(строка)
Message contents. -
headers(строка/строка[])
Additional headers. - attachments(строка/строка[])
Paths to files to attach.
-
Список изменений
С версии 5.7.0 | Введена. |
Где вызывается хук
pre_wp_mail
wp-includes/pluggable.php 211
$pre_wp_mail = apply_filters( 'pre_wp_mail', null, $atts );