AnsPress_Hooks::delete_subscribers( string $rows, string $where )

Description #

Update qameta subscribers count before deleting subscribers.

Parameters #

  • $rows
    string (Required) Number of rows deleted.
  • $where
    string (Required) Where clause.

Changelog #

VersionDescription
4.1.5Introduced.

Source #

File: includes/hooks.php

	public static function delete_subscribers( $rows, $where ) {
		if ( ! isset( $where['subs_ref_id'] ) || ! isset( $where['subs_event'] ) ) {
			return;
		}

		// Remove ids from event.
		$esc_event = ap_esc_subscriber_event( $where['subs_event'] );

		if ( in_array( $esc_event, [ 'question', 'answer', 'comment' ], true ) ) {
			ap_update_subscribers_count( $where['subs_ref_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