Activity_Helper::_before_delete( integer $post_id )

Description #

Callback for before_delete_post.

Deletes activities related to a post.

Parameters #

  • $post_id
    integer (Required) Post id.

Changelog #

VersionDescription
4.1.2Introduced.

Source #

File: includes/class/class-activity-helper.php

	public static function _before_delete( $post_id ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
		$_post = ap_get_post( $post_id );

		// Return if not AnsPress cpt.
		if ( ! ap_is_cpt( $_post ) ) {
			return;
		}

		ap_delete_post_activity( $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