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.

Top ↑

Source Source

File: wp-includes/rest-api.php

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

Top ↑

Changelog Changelog

Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.