AnsPress_Hooks::delete_subscriptions( integer $postid )

Description #

Delete subscriptions.

Parameters #

  • $postid
    integer (Required) Post ID.

Changelog #

VersionDescription
unknown Introducedunknown Introduced
4.1.5Introduced.

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,
			) );
		}
	}

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