sanitize_user WordPress Filter Hook

The sanitize_user hook is used to clean up a username before it is stored in the database. This is useful for ensuring that all usernames are lowercase, or that special characters are removed.

apply_filters( 'sanitize_user', string $username, string $raw_username, bool $strict ) #

Filters a sanitized username string.


Parameters

$username

(string)Sanitized username.

$raw_username

(string)The username prior to sanitization.

$strict

(bool)Whether to limit the sanitization to specific characters.


Top ↑

Source

File: wp-includes/formatting.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.0.1Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More