AnsPress_Hooks::update_user_vote_casted_count( integer $userid, string $type, integer $actionid, integer $receiving_userid )

Description #

Update user meta of vote

Parameters #

  • $userid
    integer (Required) User ID who is voting.
  • $type
    string (Required) Vote type.
  • $actionid
    integer (Required) Post ID.
  • $receiving_userid
    integer (Required) User who is receiving vote.

Source #

File: includes/hooks.php

	public static function update_user_vote_casted_count( $userid, $type, $actionid, $receiving_userid ) {
		$voted = ap_count_post_votes_by( 'user_id', $userid );
		// Update total casted vote of user.
		update_user_meta( $userid, '__up_vote_casted', $voted['votes_up'] );
		update_user_meta( $userid, '__down_vote_casted', $voted['votes_down'] );
	}

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