pre_wp_mail

過濾鉤子
apply_filters( 'pre_wp_mail', null, $atts )
引數
  • (null|bool) $return Short-circuit return value.
    Required:
  • (array) $atts { 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. }
    Required:
定義位置
相關勾子
wp_mailpre_user_emailpre_pingpre_wp_nav_menuwp_mail_from
相關方法
wp_mail_wp_emoji_listwp_saltwp_metathe_post_thumbnailset_post_thumbnail
引入
5.7.0
棄用
-

pre_wp_mail是一個過濾鉤子,用於在傳送郵件之前過濾傳遞給wp_mail函式的引數。這個過濾器可以用來修改電子郵件的主題、收件人、資訊、標題、附件或其他引數。

過濾是否搶先傳送電子郵件。

返回非空值將短路檢測{@see wp_mail()},而是返回該值。應使用布林返回值來指示電子郵件是否已成功傳送。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$pre_wp_mail = apply_filters( 'pre_wp_mail', null, $atts );
$pre_wp_mail = apply_filters( 'pre_wp_mail', null, $atts );
$pre_wp_mail = apply_filters( 'pre_wp_mail', null, $atts );

常見問題

FAQs
檢視更多 >