rest_authorization_required_code

函数


rest_authorization_required_code ( No parameters )
返回值
  • (int) 401 if the user is not logged in, 403 if the user is logged in.
定义位置
  • wp-includes/rest-api.php
    , line 1335
引入
4.7.0
弃用

返回授权失败的上下文HTTP错误代码。

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