rest_cookie_collect_status

Collects cookie authentication status.

Description

rest_cookie_collect_status(); 

Collects errors from wp_validate_auth_cookie for use by rest_cookie_check_errors.


Usage

  1. if ( !function_exists( 'rest_cookie_collect_status' ) ) { 
  2. require_once ABSPATH . WPINC . '/rest-api.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = rest_cookie_collect_status(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/rest-api.php  
  1. function rest_cookie_collect_status() { 
  2. global $wp_rest_auth_cookie; 
  3.  
  4. $status_type = current_action(); 
  5.  
  6. if ( 'auth_cookie_valid' !== $status_type ) { 
  7. $wp_rest_auth_cookie = substr( $status_type, 12 ); 
  8. return; 
  9.  
  10. $wp_rest_auth_cookie = true;