rest_authorization_required_code() - WordPress 函数参考中文文档

返回介绍

rest_authorization_required_code()

发布于 2017-09-11 字数6083 浏览 1048 评论 0

rest_authorization_required_code()

Returns a contextual HTTP error code for authorization failure.


描述


返回值

(integer) 401 if the user is not logged in, 403 if the user is logged in.


源代码

File: wp-includes/rest-api.php

function rest_authorization_required_code() {
	return is_user_logged_in() ? 403 : 401;
}

更新日志

Version 描述
4.7.0 Introduced.

相关函数

Uses

  • wp-includes/pluggable.php:
    is_user_logged_in()

Used By

  • wp-includes/class-wp-oembed-controller.php:
    WP_oEmbed_Controller::get_proxy_item_permissions_check()
  • wp-includes/rest-api/fields/class-wp-rest-meta-fields.php:
    WP_REST_Meta_Fields::delete_meta_value()
  • wp-includes/rest-api/fields/class-wp-rest-meta-fields.php:
    WP_REST_Meta_Fields::update_multi_meta_value()
  • wp-includes/rest-api/fields/class-wp-rest-meta-fields.php:
    WP_REST_Meta_Fields::update_meta_value()
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::check_role_update()
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::delete_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::create_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::update_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::get_items_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::get_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php:
    WP_REST_Revisions_Controller::get_items_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:
    WP_REST_Attachments_Controller::create_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php:
    WP_REST_Post_Statuses_Controller::get_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php:
    WP_REST_Post_Statuses_Controller::get_items_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php:
    WP_REST_Terms_Controller::create_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php:
    WP_REST_Terms_Controller::update_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php:
    WP_REST_Terms_Controller::delete_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php:
    WP_REST_Terms_Controller::get_items_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php:
    WP_REST_Terms_Controller::get_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::sanitize_post_statuses()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::handle_status_param()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::update_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::delete_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::delete_item()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::get_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::create_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::get_items_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php:
    WP_REST_Taxonomies_Controller::get_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php:
    WP_REST_Taxonomies_Controller::get_items_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:
    WP_REST_Post_Types_Controller::get_items_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:
    WP_REST_Post_Types_Controller::get_item()
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
    WP_REST_Comments_Controller::update_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
    WP_REST_Comments_Controller::delete_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
    WP_REST_Comments_Controller::get_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
    WP_REST_Comments_Controller::create_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
    WP_REST_Comments_Controller::get_items_permissions_check()
  • Show 31 more used by
    Hide more used by


User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!