function show_membership_status($current_member) { $role = array_shift($current_member->roles); $member_of_managment_board = carbon_get_user_meta($current_member->ID, 'crb_managment_board'); if (is_president($current_member)) { echo 'Prezes'; } elseif ($member_of_managment_board[0] == 'member_of_managment_board' && $role != 'ex_synergia_member') { echo 'Członek zarządu'; } elseif ((has_finished_projects($current_member) || $administrator) && $role != 'ex_synergia_member') { echo 'Członek koła'; } elseif ($role = 'ex_synergia_member') { echo 'Były członek koła'; } else { echo 'Członkostwo nie potwierdzono'; } }
<div class="membercard" <?php if (is_president($current_member)) { echo "id='president'"; } ?> data-id="<?php echo $current_member->ID; ?> "> <div class="membercard__avatar"> <?php echo show_avatar($current_member, 'avatar'); ?> </div> <div class="membercard__info"> <h5 class="membercard__name noWrap"> <?php echo get_member_name($current_member); ?> </h5> <div class="membercard__status"> <?php show_membership_status($current_member); ?> </div> <div class="membercard__fullProfile"></div> </div> <div class="membercard__counter"> <div class="counter" id="finished">