0 ) { $points_types_thumbnail_size = array( $points_types_thumbnail_size, $points_types_thumbnail_size ); } else { $points_types_thumbnail_size = 'gamipress-points'; } if( ! empty( $points_types_to_show ) ) : ?>
0 ) { $achievement_types_thumbnail_size = array( $achievement_types_thumbnail_size, $achievement_types_thumbnail_size ); } else { $achievement_types_thumbnail_size = 'gamipress-achievement'; } if( ! empty( $achievement_types_to_show ) ) : ?>
$user_id, 'achievement_type' => $achievement_type_to_show, 'limit' => ( $achievements_limit > 0 ? $achievements_limit : -1 ), 'groupby' => 'achievement_id', 'display' => true, ) ); // If user has not earned any achievements of this type, skip if( empty( $user_achievements ) ) { continue; } ?>
: ID, $achievement_types_thumbnail_size ); ?> ID ); ?>
0 ) { $rank_types_thumbnail_size = array( $rank_types_thumbnail_size, $rank_types_thumbnail_size ); } else { $rank_types_thumbnail_size = 'gamipress-rank'; } if( ! empty( $rank_types_to_show ) ) : ?>
: ID, $rank_types_thumbnail_size ); ?> post_title ) ) : ?> post_title; ?> post_title; ?>
0 ) { $points_types[] = $points_type_slug; } } return $points_types; } /** * Helper function to retrieve the achievement types configured at author details screen * * @since 1.0.4 * * @return array */ function gamipress_bbp_get_achievement_types() { $achievements_types = array(); $achievement_types_slugs = gamipress_get_achievement_types_slugs(); $achievements_types_to_show = gamipress_bbp_get_option( 'achievement_types', array() ); foreach( $achievements_types_to_show as $achievement_type_slug ) { // Skip if not registered if( ! in_array( $achievement_type_slug, $achievement_types_slugs ) ) { continue; } $achievements_types[] = $achievement_type_slug; } return $achievements_types; } /** * Helper function to retrieve the rank types configured at author details screen * * @param int $user_id * * @since 1.0.4 * * @return array */ function gamipress_bbp_get_rank_types( $user_id ) { $ranks_types = array(); $rank_types_slugs = gamipress_get_rank_types_slugs(); $ranks_types_to_show = gamipress_bbp_get_option( 'rank_types', array() ); // Check rank type hide option $rank_types_hide = (bool) gamipress_bbp_get_option( 'rank_types_hide', false ); foreach( $ranks_types_to_show as $rank_type_slug ) { // Skip if not registered if( ! in_array( $rank_type_slug, $rank_types_slugs ) ) { continue; } $user_rank = gamipress_get_user_rank( $user_id, $rank_type_slug ); $user_rank_is_lowest = gamipress_is_lowest_priority_rank( $user_rank->ID ); // To check if hide option is enabled if ( ! $rank_types_hide ) { $ranks_types[] = $rank_type_slug; } else if ( ! $user_rank_is_lowest ) { $ranks_types[] = $rank_type_slug; } } return $ranks_types; }