Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Shortcode: my_point_balance
- * @version 1.0
- */
- function mycred_pro_show_users_balance( $atts ) {
- if ( ! is_user_logged_in() || ! function_exists( 'mycred' ) ) return;
- extract( shortcode_atts( array(
- 'type' => 'mycred_default'
- ), $atts ) );
- $mycred = mycred( $type );
- $user_id = get_current_user_id();
- $output = '';
- if ( ! $mycred->exclude_user( $user_id ) ) {
- $balance = $mycred->get_users_balance( $user_id );
- $output = intval( $balance );
- }
- return number_format( $output, 0, '.', '.' );
- }
- add_shortcode( 'my_point_balance', 'mycred_pro_show_users_balance' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement