Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Show User Custom Meta

Get Custom User Meta balance or balance_temp

// Add Shortcode
function show_user_balance( $atts ) {

	// Attributes
	extract( shortcode_atts(
		array(
			'temp' => '0',
			'id' => '',
		), $atts )
	);

	// Code
if ($atts['temp'] == '') { 
  $balance_type = 'balance';
} else {
  $balance_type = 'balance_temp';
}

if ($atts['id']) { 
  $user_id = $atts['id'];
} else {
  global $current_user;
  $user_id = $current_user->ID;
}
$balance = get_user_meta($user_id, $balance_type , $single=true); 
return sprintf("%1.2f", $balance) . ' ₺';

}
add_shortcode( 'balance', 'show_user_balance' );