wpseek.com
A WordPress-centric search engine for devs and theme authors



rest_authorization_required_code › WordPress Function

Since4.7.0
Deprecatedn/a
rest_authorization_required_code ( No parameters )
Returns:
  • (int) 401 if the user is not logged in, 403 if the user is logged in.
Defined at:
Codex:

Returns a contextual HTTP error code for authorization failure.



Source

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