AnsPress_Email_Hooks::delete_comment_subscriptions( integer $comment_id )

Description #

Delete comment subscriptions right before deleting comment.

Parameters #

  • $comment_id
    integer (Required) Comment ID.

Source #

File: addons/free/email.php

	public static function delete_comment_subscriptions( $comment_id ) {
		$_comment = get_comment( $comment_id );
		$_post = get_post( $_comment->comment_post_ID );

		if ( in_array( $_post->post_type, [ 'question', 'answer' ], true ) ) {
			ap_delete_subscribers( 'comment_' . $_post->ID );
		}
	}

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