wc_generate_order_key( string $key = '' )

Generate an order key with prefix.

Description Description

Parameters Parameters


(Optional) Order key without a prefix. By default generates a 13 digit secret.

Default value: ''

Top ↑

Return Return

(string) The order key.

Top ↑

Source Source

File: includes/wc-order-functions.php

function wc_generate_order_key() {
	return 'wc_' . apply_filters( 'woocommerce_generate_order_key', 'order_' . wp_generate_password( 13, false ) );

Top ↑

Changelog Changelog

Version Description
3.5.4 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.