AnsPress_Reputation_Hooks::delete_user( integer $user_id )

Description #

Delete all reputation of user when user get deleted.

Parameters #

  • $user_id
    integer (Required) User ID.

Source #

File: addons/free/reputation.php

	public static function delete_user( $user_id ) {
		global $wpdb;
		$delete = $wpdb->delete( $wpdb->ap_reputations, [ 'repu_user_id' => $user_id ], [ '%d' ] ); // WPCS: db call okay, db cache okay.

		if ( false !== $delete ) {
			do_action( 'ap_bulk_delete_reputations_of_user', $user_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