钩子文档

send_retrieve_password_email

💡 云策文档标注

概述

send_retrieve_password_email 是一个 WordPress 过滤器,用于控制是否发送密码重置邮件。开发者可以通过此 Hook 自定义邮件发送逻辑,例如基于条件禁用发送。

关键要点

  • 过滤器名称:send_retrieve_password_email
  • 作用:过滤是否发送密码重置邮件,返回 false 可禁用发送
  • 参数:$send(布尔值,是否发送邮件)、$user_login(字符串,用户名)、$user_data(WP_User 对象)
  • 相关函数:retrieve_password() 用于处理密码重置邮件发送
  • 版本:自 WordPress 6.0.0 引入

📄 原文内容

Filters whether to send the retrieve password email.

Description

Return false to disable sending the email.

Parameters

$sendbool
Whether to send the email.
$user_loginstring
The username for the user.
$user_dataWP_User
WP_User object.

Source

if ( ! apply_filters( 'send_retrieve_password_email', true, $user_login, $user_data ) ) {

Changelog

Version Description
6.0.0 Introduced.