| @@ -219,8 +219,13 @@ | ||
| 219 | 219 | if ( empty( $reply_id ) ) { |
| 220 | 220 | $reply_id = bbp_get_reply_id( $reply_id ); |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | + // the_content/the_excerpt run for every post; only replies can be private. | |
| 224 | + if ( empty( $reply_id ) ) { | |
| 225 | + return $content; | |
| 226 | + } | |
| 227 | + | |
| 223 | 228 | if ( $this->is_private( $reply_id ) ) { |
| 224 | 229 | if ( ! $this->can_view_private_reply( $reply_id ) ) { |
| 225 | 230 | $content = '<div class="alert alert-danger">' . esc_html__( 'This reply has been marked as private.', 'forumax' ) . '</div>'; |
| 226 | 231 | } |