rest_authorization_required_code()
Returns a contextual HTTP error code for authorization failure.
Description #Description
Return #Return
(integer) 401 if the user is not logged in, 403 if the user is logged in.
Source #Source
File: wp-includes/rest-api.php
function rest_authorization_required_code() { return is_user_logged_in() ? 403 : 401; }
Expand full source code Collapse full source code View on Trac
Changelog #Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |
Related #Related
Uses #Uses
Uses | Description |
---|---|
wp-includes/pluggable.php: is_user_logged_in() |
Determines whether the current visitor is a logged in user. |
Used By #Used By
Used By | Description |
---|---|
wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php: WP_REST_Themes_Controller::get_items_permissions_check() |
Checks if a given request has access to read the theme. |
wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php: WP_REST_Autosaves_Controller::get_items_permissions_check() |
Checks if a given request has access to get autosaves. |
wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php: WP_REST_Block_Renderer_Controller::get_item_permissions_check() |
Checks if a given request has access to read blocks. |
wp-includes/class-wp-oembed-controller.php: WP_oEmbed_Controller::get_proxy_item_permissions_check() |
Checks if current user can make a proxy oEmbed request. |
wp-includes/rest-api/fields/class-wp-rest-meta-fields.php: WP_REST_Meta_Fields::delete_meta_value() |
Deletes a meta value for an object. |
wp-includes/rest-api/fields/class-wp-rest-meta-fields.php: WP_REST_Meta_Fields::update_multi_meta_value() |
Updates multiple meta values for an object. |
wp-includes/rest-api/fields/class-wp-rest-meta-fields.php: WP_REST_Meta_Fields::update_meta_value() |
Updates a meta value for an object. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::check_role_update() |
Determines if the current user is allowed to make the desired roles change. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::delete_item_permissions_check() |
Checks if a given request has access delete a user. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::create_item_permissions_check() |
Checks if a given request has access create users. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::update_item_permissions_check() |
Checks if a given request has access to update a user. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::get_items_permissions_check() |
Permissions check for getting all users. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::get_item_permissions_check() |
Checks if a given request has access to read a user. |
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php: WP_REST_Revisions_Controller::get_item() |
Retrieves one revision from the collection. |
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php: WP_REST_Revisions_Controller::delete_item_permissions_check() |
Checks if a given request has access to delete a revision. |
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php: WP_REST_Revisions_Controller::get_items_permissions_check() |
Checks if a given request has access to get revisions. |
wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php: WP_REST_Attachments_Controller::create_item_permissions_check() |
Checks if a given request has access to create an attachment. |
wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php: WP_REST_Post_Statuses_Controller::get_item_permissions_check() |
Checks if a given request has access to read a post status. |
wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php: WP_REST_Post_Statuses_Controller::get_items_permissions_check() |
Checks whether a given request has permission to read post statuses. |
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::create_item_permissions_check() |
Checks if a request has access to create a term. |
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::update_item_permissions_check() |
Checks if a request has access to update the specified term. |
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::delete_item_permissions_check() |
Checks if a request has access to delete the specified term. |
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::get_items_permissions_check() |
Checks if a request has access to read terms in the specified taxonomy. |
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::get_item_permissions_check() |
Checks if a request has access to read or edit the specified term. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::sanitize_post_statuses() |
Sanitizes and validates the list of post statuses, including whether the user can query private statuses. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::handle_status_param() |
Determines validity and normalizes the given status parameter. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::update_item_permissions_check() |
Checks if a given request has access to update a post. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::delete_item_permissions_check() |
Checks if a given request has access to delete a post. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::delete_item() |
Deletes a single post. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::get_item_permissions_check() |
Checks if a given request has access to read a post. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::create_item_permissions_check() |
Checks if a given request has access to create a post. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::get_items_permissions_check() |
Checks if a given request has access to read posts. |
wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php: WP_REST_Taxonomies_Controller::get_item_permissions_check() |
Checks if a given request has access to a taxonomy. |
wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php: WP_REST_Taxonomies_Controller::get_items_permissions_check() |
Checks whether a given request has permission to read taxonomies. |
wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php: WP_REST_Post_Types_Controller::get_items_permissions_check() |
Checks whether a given request has permission to read types. |
wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php: WP_REST_Post_Types_Controller::get_item() |
Retrieves a specific post type. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::update_item_permissions_check() |
Checks if a given REST request has access to update a comment. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::delete_item_permissions_check() |
Checks if a given request has access to delete a comment. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::get_item_permissions_check() |
Checks if a given request has access to read the comment. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::create_item_permissions_check() |
Checks if a given request has access to create a comment. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::get_items_permissions_check() |
Checks if a given request has access to read comments. |
wp-includes/rest-api/class-wp-rest-server.php: WP_REST_Server::dispatch() |
Matches the request to a callback and call it. |