Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*****************************************************
- * *
- * Giving coice for Admin and users to add preferred *
- * sport preferred team details for that sport while *
- * creating and registering respetively. *
- * *
- ****************************************************/
- /* Choice of adding preferred team details for an user by admin in administration section */
- add_action( 'user_registration', 'add_prefered_team_details' );
- /* Choice of adding preferred team details by an user while registering */
- add_action('register_form','add_prefered_team_details');
- /* Adding team details callback function */
- function add_prefered_team_details( $user ) {
- echo '<table class="form-table user-team-data"><tbody>';
- echo '<tr class="form-field"><th scope="row"><label for="role">Choose a sport</label></th>';
- global $leaguemanager;
- echo '<td><select size="1" name="sport[noofplayers]" id="choose-sport">';
- foreach ( $leaguemanager->getNoOfPlayers() AS $id => $players ) :
- foreach ( $leaguemanager->getLeagueTypes() AS $ID => $title ) :
- if ($id == $ID) {
- $name = $title;
- echo '<option value='.$players.'>'.$title.'</option>';
- }
- endforeach;
- endforeach;
- echo '</select></td></tr></tbody></table>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement