AnsPress_Admin_Ajax::recount_answer_reputation( integer $user_id, string $event )
Description #
Recount reputation for answering a question.
Parameters #
- $user_idinteger (Required) User id.
- $eventstring (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 ) {
}
}
}
Expand full source code Collapse full source code View on GitHub: admin/ajax.php:465
Add your comment