plugins/bbpress/includes/replies/capabilities.php
/** Deleting **********************************************************/
case 'delete_reply' :
// Get the post
$_post = get_post( $args[0] );
if ( !empty( $_post ) ) {
// Get caps for post type object
$post_type = get_post_type_object( $_post->post_type );
$caps = array();
// Add 'do_not_allow' cap if user is spam or deleted
if ( bbp_is_user_inactive( $user_id ) ) {
$caps[] = 'do_not_allow';
// Moderators can always edit forum content
// } elseif ( user_can( $user_id, 'moderate' ) ) {
// $caps[] = 'moderate';
// User is author so allow edit if not in admin
} elseif ( !is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
$caps[] = $post_type->cap->edit_posts;
// Unknown so map to delete_others_posts
} else {
$caps[] = $post_type->cap->delete_others_posts;
}
}
break;