WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Automattic\WooCommerce\Blocks\Domain\Services

CreateAccount::from_order_request() public WC 1.0

Create a user account for specified request (if necessary). If a new account is created:

  • The user is logged in.

{} Это метод класса: CreateAccount{}

Хуков нет.

Возвращает

int. The new user id, or 0 if no user was created.

Использование

$CreateAccount = new CreateAccount();
$CreateAccount->from_order_request( $request );
$request(WP_REST_Request) (обязательный)
The current request object being handled.

Код CreateAccount::from_order_request() WC 5.6.0

public function from_order_request( \WP_REST_Request $request ) {
	if ( ! self::is_feature_enabled() || ! $this->should_create_customer_account( $request ) ) {
		return 0;
	}

	$customer_id = $this->create_customer_account(
		$request['billing_address']['email'],
		$request['billing_address']['first_name'],
		$request['billing_address']['last_name']
	);
	// Log the customer in and associate with the order.
	wc_set_customer_auth_cookie( $customer_id );

	return $customer_id;
}