Automattic\WooCommerce\StoreApi\Routes\V1

AbstractCartRoute::requires_nonce()protectedWC 1.0

Checks if a nonce is required for the route.

Method of the class: AbstractCartRoute{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->requires_nonce( $request );
$request(\WP_REST_Request) (required)
Request.

AbstractCartRoute::requires_nonce() code WC 9.4.2

protected function requires_nonce( \WP_REST_Request $request ) {
	return $this->is_update_request( $request ) && ! $this->has_cart_token( $request );
}