ap_get_user_reputation_meta( integer|bool $user_id = false, boolean $short = true )

Description #

Get user reputation from user meta.

Parameters #

  • $user_id
    integer | bool (Optional) User id. Default value: false
  • $short
    boolean (Optional) Shorten count number. Default value: true

Source #

File: includes/reputation.php

function ap_get_user_reputation_meta( $user_id = false, $short = true ) {
	if ( false === $user_id ) {
		$user_id = get_current_user_id();
	}

	$meta = get_user_meta( $user_id, 'ap_reputations', true ); // @codingStandardsIgnoreLine.

	if ( false === $short ) {
		return $meta;
	}

	return ap_short_num( $meta );
}

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