AnsPress_Views::delete_views( integer $post_id )

Description #

Delete views count when post is deleted.

Parameters #

  • $post_id
    integer (Required) Post ID.

Source #

File: includes/views.php

	public static function delete_views( $post_id ) {
		global $wpdb;

		if ( apply_filters( 'ap_insert_view_to_db', false ) ) {
			$wpdb->delete( $wpdb->ap_views, array( 'view_ref_id' => $post_id ), array( '%d' ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
		}
	}

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