mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Generate random default prefix
This commit is contained in:
parent
a832ac427c
commit
fc61039537
1 changed files with 4 additions and 1 deletions
|
@ -711,7 +711,10 @@ return array(
|
|||
'type' => 'text',
|
||||
'desc_tip' => true,
|
||||
'description' => __( 'If you use your PayPal account with more than one installation, please use a distinct prefix to separate those installations. Please do not use numbers in your prefix.', 'woocommerce-paypal-payments' ),
|
||||
'default' => 'WC-',
|
||||
'default' => (static function (array $allowedSymbols): string { //Generate random string from 4 letters and -.
|
||||
$default_prefix_chars = array_rand(array_flip($allowedSymbols), 4);
|
||||
return implode('', $default_prefix_chars) . '-';
|
||||
})(range('A', 'Z')),
|
||||
'screens' => array(
|
||||
State::STATE_PROGRESSIVE,
|
||||
State::STATE_ONBOARDED,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue