钩子文档

wpmu_validate_user_signup

💡 云策文档标注

概述

wpmu_validate_user_signup 是一个 WordPress 过滤器钩子,用于在用户注册过程中过滤已验证的用户注册详情。它主要用于验证和错误处理,但不允许覆盖用户名或邮箱。

关键要点

  • 这是一个过滤器钩子,应用于多站点环境中的用户注册验证过程。
  • 参数 $result 是一个数组,包含用户名、邮箱和错误消息,用于传递验证结果。
  • 该钩子不允许修改用户名或邮箱,仅用于验证和错误处理。
  • 相关函数 wpmu_validate_user_signup() 用于清理和验证用户注册数据。
  • 自 WordPress MU 3.0.0 版本引入。

📄 原文内容

Filters the validated user registration details.

Description

This does not allow you to override the username or email of the user during registration. The values are solely used for validation and error handling.

Parameters

$resultarray
The array of user name, email, and the error messages.

  • user_name string
    Sanitized and unique username.
  • orig_username string
    Original username.
  • user_email string
    User email address.
  • errors WP_Error
    WP_Error object containing any errors found.

Source

return apply_filters( 'wpmu_validate_user_signup', $result );

Changelog

Version Description
MU (3.0.0) Introduced.