wc_generate_order_key()
Generate an order key with prefix.
Hooks from the function
Return
String
. The order key.
Usage
wc_generate_order_key( $key );
- $key(string)
- Order key without a prefix. By default generates a 13 digit secret.
Default: ''
Changelog
Since 3.5.4 | Introduced. |
wc_generate_order_key() wc generate order key code WC 9.4.2
function wc_generate_order_key( $key = '' ) { if ( '' === $key ) { $key = wp_generate_password( 13, false ); } return 'wc_' . apply_filters( 'woocommerce_generate_order_key', 'order_' . $key ); }