LLMS_REST_Users_Controller::sanitize_password( string $value, WP_REST_Request $request, string $param )

Validate a username is valid and allowed

Parameters Parameters


(string) (Required) User-submitted username.


(WP_REST_Request) (Required) Request object.


(string) (Required) Parameter name.

Top ↑

Return Return

(WP_Error|string) Sanitized username if valid or error object.

Top ↑

Source Source

File: libraries/lifterlms-rest/includes/abstracts/class-llms-rest-users-controller.php

	public function sanitize_password( $value, $request, $param ) {

		$password = (string) $value;

		if ( false !== strpos( $password, '\\' ) ) {
			return llms_rest_bad_request_error( __( 'Passwords cannot contain the "\\" character.', 'lifterlms' ) );

		// @todo: Should validate against password strength too, maybe?

		return $password;


Top ↑

Changelog Changelog

Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.