Hide Woocommere Pages
-
Hi UM Team…i want to hide all woocommerce pages from guests and a specific UM role…all i have is a snippet i found on the web…can you help me…this the original snippet…
function woocommerce_hide_woopages() { if( ( is_woocommerce()) && ! ( current_user_can( 'somerole' ) || current_user_can( 'administrator' ) ) ) { wp_redirect( site_url( '/' )); exit(); } } add_action( 'template_redirect','woocommerce_hide_woopages' );
and i tried this…but does not work…
function woocommerce_hide_woopages() { if( ( is_woocommerce()) && ! ( um_user('Hoerexe') || um_user('Admin') ) ) { wp_redirect( site_url( '/' )); exit(); } } add_action( 'template_redirect','woocommerce_hide_woopages' );
would be great if you can help me!!! Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Hide Woocommere Pages’ is closed to new replies.