Code-Snippets-Functions/Execute a function on a child site/WooCommerce/change-auto-generated-password.txt

9 lines
246 B
Text

function wcs_filter_password_auto( $args ) {
$new_password = wp_generate_password( 6, true, true );
$args['user_pass'] = $new_password;
return $args;
}
add_filter( 'woocommerce_new_customer_data', 'wcs_filter_password_auto' );