@haagsekak, try this one.
function wps_get_comment_list_by_user($clauses) {
if (is_admin()) {
global $user_ID, $wpdb;
$clauses['join'] = ", wp_posts";
$clauses['where'] .= " AND wp_posts.post_author = ".$user_ID." AND wp_comments.comment_post_ID = wp_posts.ID";
};
return $clauses;
};
if(!current_user_can('edit_others_posts')) {
add_filter('comments_clauses', 'wps_get_comment_list_by_user');
}
Or you can exclude the post_types that are related to bbPress with
if ( !in_array($post_type, array(‘topic’, ‘forum’, ‘reply’) ) ) .
Mentioned above code with the modification:
$parentsDirs = "";
if( !$leavename ){
$postId = $post->ID;
if ( !in_array($post_type, array('topic', 'forum', 'reply') ) ) {
while ($parent = get_post($postId)->post_parent) {
$parentsDirs = get_post($parent)->post_name."/".$parentsDirs;
$postId = $parent;
}
}
}