AnsPress_Hooks::delete_comment_subscriptions( integer $comment_id, int|WP_Comment $_comment )
Description #
Delete comment subscriptions right before deleting comment.
Parameters #
- $comment_idinteger (Required) Comment ID.
- $_commentint | WP_Comment (Required) Comment object.
Changelog #
Version | Description |
---|---|
unknown Introduced | unknown Introduced |
4.1.8 | Changed event. |
4.1.5 | Introduced. |
Source #
File: includes/hooks.php
public static function delete_comment_subscriptions( $comment_id, $_comment ) { $_post = get_post( $_comment->comment_post_ID ); if ( in_array( $_post->post_type, [ 'question', 'answer' ], true ) ) { $type = $_post->post_type . '_' . $_post->ID; $row = ap_delete_subscribers( array( 'subs_event' => $type, 'subs_ref_id' => $_comment->comment_ID, ) ); } }
Expand full source code Collapse full source code View on GitHub: includes/hooks.php:1048
Add your comment