rest_cookie_collect_status() WordPress Function

The rest_cookie_collect_status() function is used to collect the status code of the current request. This is used to determine if the request is successful or not. The function is also used to collect the cookies from the current request.

rest_cookie_collect_status() #

Collects cookie authentication status.


Description

Collects errors from wp_validate_auth_cookie for use by rest_cookie_check_errors.

Top ↑

See also


Top ↑

Source

File: wp-includes/rest-api.php

function rest_cookie_collect_status() {
	global $wp_rest_auth_cookie;

	$status_type = current_action();

	if ( 'auth_cookie_valid' !== $status_type ) {
		$wp_rest_auth_cookie = substr( $status_type, 12 );
		return;
	}

	$wp_rest_auth_cookie = true;
}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More