ceramofiles

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • ceramofiles
    Participant

    That did it thank you!

    in reply to: Specific users not blocked from adding events #105449
    ceramofiles
    Participant

    Great! So that code made it so when those users go to the submit events page it gives them an error; however, the events tab still shows up in their admin bar and they can add events if they click events > add event. Is it possible to remove the events tab from the admin bar for only subscribers and our custom role? Thanks!

    in reply to: Specific users not blocked from adding events #104982
    ceramofiles
    Participant

    Thanks for the code. This looks like the right solution; however, when I add it to functions.php, I get some kind of error. The site admin and site display a blank page and when I remove the code through ftp the site displays correctly again. I changed the role and the redirect url. Here is the exact code I used (except for the site url), perhaps there is a php error?:
    add_action( ‘wp_head’, ‘community_restrict_access’ );
    function community_restrict_access() {
    if (tribe_is_community_edit_event_page() || tribe_is_community_my_events_page()) {
    if(current_user_can(‘subscriber’) || current_user_can(‘pro_member’) {
    wp_redirect( ‘http://www.mysiteurl.com’, 301 ); exit;
    }
    }
    }

    Thanks so much for your help on this!

Viewing 3 posts - 1 through 3 (of 3 total)