i tried also this…
function woocommerce_hide_woopages() {
if( ( is_woocommerce()) AND ( um_user('Hoerexe') OR !is_user_logged_in() ) ) {
wp_redirect( site_url( '/' ));
exit();
}
}
add_action( 'template_redirect','woocommerce_hide_woopages' );
this works for non logged in users…they redirect to the homepage…but when a user with the UM role Hoerexe is logged in he can still view the woocommerce pages…how can i solve this? Thanks!