AnsPress_Admin_Ajax::recount_answer_reputation( integer $user_id, string $event )

Description #

Recount reputation for answering a question.

Parameters #

  • $user_id
    integer (Required) User id.
  • $event
    string (Required) Event type.

Source #

File: admin/ajax.php

	public function recount_answer_reputation( $user_id, $event ) {
		global $wpdb;

		$post_ids = $wpdb->get_col(
			$wpdb->prepare( "SELECT ID FROM {$wpdb->ap_reputation} WHERE post_author = %d AND post_type = 'answer' AND post_status IN ('publish', 'private_post')", $user_id )
		);

		// Return if no answers found.
		if ( empty( $post_ids ) ) {
			return true;
		}

		$events = ap_search_array( ap_get_reputation_events(), 'parent', 'answer' );

		foreach ( (array) $post_ids as $id ) {
				$exists = ap_get_reputation( $e, $id, $user_id );

				if ( ! $exists ) {

				}
		}
	}

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