AnsPress_Hooks::delete_subscriptions( integer $postid )
Description #
Delete subscriptions.
Parameters #
- $postidinteger (Required) Post ID.
Changelog #
| Version | Description |
|---|---|
| unknown Introduced | unknown Introduced |
| 4.1.5 | Introduced. |
Source #
File: includes/hooks.php
public static function delete_subscriptions( $postid ) {
$_post = get_post( $postid );
if ( 'question' === $_post->post_type ) {
// Delete question subscriptions.
ap_delete_subscribers( array(
'subs_event' => 'question',
'subs_ref_id' => $postid,
) );
}
if ( 'answer' === $_post->post_type ) {
// Delete question subscriptions.
ap_delete_subscribers( array(
'subs_event' => 'answer_' . $_post->post_parent,
) );
}
}
Expand full source code Collapse full source code View on GitHub: includes/hooks.php:999
Add your comment