/** Lis all members with edit buttons */ function flipping_team_view() { if( isset( $_REQUEST['deleteid'] ) ) { $id = $_REQUEST['deleteid']; $deleted = flipping_team_delete( $id ); if ( $deleted ) { $msg = __('Member deleted.', 'flpt' ); } else { $error = __( 'Unable to delete member.', 'flpt' ); } } ?> <div class='wrap'> <h2><?php _e( 'View All Team Members', 'flpt' ); ?> <a class="add-new-h2" href="admin.php?page=flipping-team-member"><?php _e( 'Add', 'flpt'); ?></a></h2> <?php if ( $error ) { ?> <div class="error"><?php echo $error; ?></div> <?php } ?> <?php if ( $msg ) { ?> <div class="updated"><?php echo $msg; ?></div> <?php } ?> <?php $members = flipping_team_get_all( "alpha" ); if ( count( $members ) > 0 ) { ?> <ul class="team-members-list"> <?php foreach ($members as $member) { echo flipping_team_display_one( $member, flipping_team_opt_use_flipping_effect() ); ?> <li class="flipping-team-tool-bar"> <form action="admin.php"> <input type='hidden' name='page' value="flipping-team-member"/> <input type='hidden' name='action' value="edit"/> <input type='hidden' name='editid' value="<?php echo $member['id'];?>"/> <input type='submit' class='button-secondary' value='<?php _e( 'Edit' ); ?>' /> </form> <form action="admin.php"> <input type='hidden' name='page' value="flipping-team"/> <input type='hidden' name='action' value="delete"/> <input type='hidden' name='deleteid' value="<?php echo $member['id'];?>"/> <input type='submit' class='button-secondary' value='<?php _e( 'Delete' ); ?>' /> </form> </li> <? } } else { ?> <p><?php _e( 'There is currently no member in your team', 'flpt' ); ?></p> <?php } ?> </ul> </div> <?php }
/** Shortcode function * @param $atts not used */ function flipping_team_shortcode($atts) { $members = flipping_team_get_all("alpha"); $output .= '<ul class="team-members-list">'; // Looping through the array: foreach ($members as $member) { $output .= flipping_team_display_one($member, flipping_team_opt_use_flipping_effect()); } $output .= '</ul>'; return $output; }