rest_authorization_required_code

Returns a contextual HTTP error code for authorization failure.

Description

(integer) rest_authorization_required_code(); 

Returns (integer)


Usage

  1. if ( !function_exists( 'rest_authorization_required_code' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/vendor/wp-rest-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = rest_authorization_required_code(); 
  7.  

Defined (1)

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

/includes/vendor/wp-rest-functions.php  
  1. function rest_authorization_required_code() { 
  2. return is_user_logged_in() ? 403 : 401;