Reply To: Function checking access

Author
Reply
  • #2543

    Why is that? For example here this works:

    function is_current_user_skip_protect( $type, $forum_id = 0 ) {
    global $sbv_core_bbpress;
    $sbv_bbpress = new sbv_bbpress();
    $user_id = get_current_user_id();
    $skip = sbv_is_current_user_with_role( $sbv_bbpress->get( ‘access_unrestriced_user_roles’ ) );
    $skip = apply_filters( ‘sbv_skip_protect_check_’ . $type, $skip, $user_id );
    if ( ! $skip ) {
    return true;
    } else {
    return false;
    }
    }

    and

    if ( ! is_current_user_skip_protect( $user_id ) ) {
    get_template_part( ‘templates/secondary/secondary’, ‘bbp’ );
    }