ap_get_reputation( string $event, integer $ref_id, integer|boolean $user_id = false )

Description #

Get reputation.

Parameters #

  • $event
    string (Required) Event type.
  • $ref_id
    integer (Required) Reference ID (post or comment ID).
  • $user_id
    integer | boolean (Optional) User ID. Default value: false

Source #

File: includes/reputation.php

function ap_get_reputation( $event, $ref_id, $user_id = false ) {
	global $wpdb;

	if ( false === $user_id ) {
		$user_id = get_current_user_id();
	}

	$reputation = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->ap_reputations WHERE rep_user_id = %d AND rep_ref_id = %d AND rep_event = %s", $user_id, $ref_id, $event ) );  // phpcs:ignore WordPress.DB

	return $reputation;
}

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