rest_authorization_required_code(): int

Returns a contextual HTTP error code for authorization failure.


Return

int 401 if the user is not logged in, 403 if the user is logged in.


Top ↑

Source

File: wp-includes/rest-api.php. View all references

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

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