How to Customize Excerpts for Password...
Optimize your WordPress site! This snippet customizes excerpts for password-protected...

WPCodeBox
540
Learn how to set the default user registration role in WooCommerce with this simple code snippet. Perfect for managing new customer roles on your e-commerce site.
/**
* Author: WP Turned UP
* Author URI: https://wpturnedup.com
*/
//// In our example here, we are setting the default role to the 'Subscriber' role, and you can set your desired role
//// by editing the '$args['role'] = 'subscriber';' entry.
//// ----------------- CODE SNIPPET IS BELOW THIS LINE - REMOVE THIS LINE AND ABOVE -----------------
// Set Woocommerce Default User Registration Role
add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1);
function wc_assign_custom_role($args) {
$args['role'] = 'subscriber';
return $args;
}





Move WPCodeBox menu to the top bar for easy access in WordPress.
