Mika MAtikainen
Apr 15, 2020 · 4 min read
How to Test Temporary Maintenance in WordPress?
This snippet I always place right at the top of my functions.php file. This will stop any users from seeing your website except logged in Administrators. Useful if you are doing some quick work that may cause the theme to break if something goes wrong.
function wps_woo_custom_new_customer_data( $new_customer_data ) {
$new_customer_data['role'] = 'subscriber'; // change the role here
return $new_customer_data;
}
add_filter( 'woocommerce_new_customer_data', 'wps_woo_custom_new_customer_data');