| @@ -138,9 +138,9 @@ | ||
| 138 | 138 | /** |
| 139 | 139 | * Hooked into the new reply function, this notification action is responsible |
| 140 | 140 | * for notifying topic and hierarchical reply authors of topic replies. |
| 141 | 141 | * |
| 142 | - * @since 2.5.0 bbPress (r5156) | |
| 142 | + * @since 2.5.0 bbPress (r5155) | |
| 143 | 143 | * |
| 144 | 144 | * @param int $reply_id |
| 145 | 145 | * @param int $topic_id |
| 146 | 146 | * @param int $forum_id (not used) |
| @@ -152,8 +152,13 @@ | ||
| 152 | 152 | function bbp_buddypress_add_notification( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = array(), $author_id = 0, $is_edit = false, $reply_to = 0 ) { |
| 153 | 153 | |
| 154 | 154 | // Bail if somehow this is hooked to an edit action |
| 155 | 155 | if ( ! empty( $is_edit ) ) { |
| 156 | + return; | |
| 157 | + } | |
| 158 | + | |
| 159 | + // Bail if the reply is not published | |
| 160 | + if ( ! bbp_is_reply_published( $reply_id ) ) { | |
| 156 | 161 | return; |
| 157 | 162 | } |
| 158 | 163 | |
| 159 | 164 | // Get author information |