HTTP/2 301
server: nginx
date: Sun, 28 Dec 2025 13:14:48 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/functions/rest_application_password_check_errors/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
HTTP/2 200
server: nginx
date: Sun, 28 Dec 2025 13:14:48 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
rest_application_password_check_errors() – Function | Developer.WordPress.org
WordPress Developer Resources
rest_application_password_check_errors()
rest_application_password_check_errors( WP_Error|null|true $result ): WP_Error|null|true
Checks for errors when using application password-based authentication.
$resultWP_Error|null|truerequiredError from another authentication handler, null if we should handle it, or another value if not.
WP_Error|null|true WP_Error if the application password is invalid, the $result, otherwise true.
function rest_application_password_check_errors( $result ) {
global $wp_rest_application_password_status;
if ( ! empty( $result ) ) {
return $result;
}
if ( is_wp_error( $wp_rest_application_password_status ) ) {
$data = $wp_rest_application_password_status->get_error_data();
if ( ! isset( $data['status'] ) ) {
$data['status'] = 401;
}
$wp_rest_application_password_status->add_data( $data );
return $wp_rest_application_password_status;
}
if ( $wp_rest_application_password_status instanceof WP_User ) {
return true;
}
return $result;
}
View all references View on Trac View on GitHub
| Version | Description |
|---|
| 5.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.