/** * Get the number of available seat * * @param int $meetup_id * @return int */ function meetup_num_available_seat($meetup_id) { $capacity = meetup_get_capacity($meetup_id); $filled = meetup_num_booked_seat($meetup_id); return $capacity - $filled; }
/** * Custom Column value for post form builder * * @param string $column_name * @param int $post_id */ function meetup_post_type_admin_column_value($column_name, $post_id) { switch ($column_name) { case 'meetup_date': $from = get_post_meta($post_id, 'from', true); if (!empty($from)) { echo date_i18n('F j, Y g:ia', $from); } break; case 'capacity': echo meetup_get_capacity($post_id); break; case 'booked': echo meetup_num_booked_seat($post_id); break; case 'available': echo meetup_num_available_seat($post_id); break; default: # code... break; } }
</h1> </div> </div><!-- .meetup-date-title-wrap --> </div><!-- .meetup-event-header --> </div><!-- .meetup-cover-wrap --> <div class="meetup-nav-wrap"> <div class="meetup-nav"> <?php echo meetup_navigation(); ?> </div><!-- .meetup-nav --> <?php $capacity = meetup_get_capacity($post_id); $booked = meetup_num_booked_seat($post_id); $seat_available = meetup_num_available_seat($post_id); ?> <div class="meetup-actions-wrap"> <ul class="meetup-actions"> <li> <div class="meetup-count"><?php echo $capacity; ?> </div> <div class="meetup-span-text"><?php _e('Capacity', 'meetup'); ?> </div> </li>