BuddyPress::remove_comment_notify( object $comment )

Description #

Remove answer notification when corresponding answer get deleted.

Parameters #

  • $comment
    object (Required) Comment object.

Source #

File: addons/buddypress/buddypress.php

	public function remove_comment_notify( $comment ) {
		if ( ! bp_is_active( 'notifications' ) ) {
			return;
		}

		if ( isset( $comment->comment_ID ) && $comment->comment_ID ) {
			bp_notifications_delete_all_notifications_by_type( $comment->comment_ID, 'anspress', 'new_comment' );
		} else {
			$comments = get_comments( array( 'post_id' => $comment ) );
			foreach ( (array) $comments as $comment ) {
				bp_notifications_delete_all_notifications_by_type( $comment->comment_ID, 'anspress', 'new_comment' );
			}
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment