llms_rest_authorization_required_error( string $message = '', boolean $check_authenticated = true )
Return a WP_Error with proper code, message and status for unauthorized requests.
Description Description
Parameters Parameters
- $message
-
(Optional) The custom error message. When no custom message is provided a predefined message will be used.
Default value: ''
- $check_authenticated
-
(Optional) Whether or not checking if the current user is logged in. Default
true
.Default value: true
Return Return
(WP_Error)
Source Source
File: libraries/lifterlms-rest/includes/server/llms-rest-server-functions.php
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.18 | Use WP_Http constants for the error status. |
1.0.0-beta.12 | Added a second paramater to avoid checking if the user is logged in. |
1.0.0-beta.1 | Introduced. |