wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.
validate_username › WordPress Function
Od2.0.1
Przestarzałyn/a
› validate_username ( $username )
| Parametry: |
|
| Powrót: |
|
| Zdefiniowane na: |
|
| Codex: | |
| Dziennik zmian: |
|
Checks whether a username is valid.
Powiązane Funkcje: validate_user_form, validate_user_signup, validate_current_theme, validate_email, rest_validate_enum
Źródło
function validate_username( $username ) {
$sanitized = sanitize_user( $username, true );
$valid = ( $sanitized === $username && ! empty( $sanitized ) );
/**
* Filters whether the provided username is valid.
*
* @since 2.0.1
*
* @param bool $valid Whether given username is valid.
* @param string $username Username to check.
*/
return apply_filters( 'validate_username', $valid, $username );
}