Advertisement
mogaj

extrafields

Jul 25th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.34 KB | None | 0 0
  1. /*****************************************************
  2.  *                           *
  3.  * Giving coice for Admin and users to add preferred *
  4.  * sport preferred team details for that sport while *
  5.  * creating and registering respetively.             *
  6.  *                           *
  7.  ****************************************************/
  8. /* Choice of adding preferred team details for an user by admin in administration section */
  9. add_action( 'user_registration', 'add_prefered_team_details' );
  10. /* Choice of adding preferred team details by an user while registering */
  11. add_action('register_form','add_prefered_team_details');
  12. /* Adding team details callback function */
  13. function add_prefered_team_details( $user ) {
  14.   echo '<table class="form-table user-team-data"><tbody>';
  15.   echo '<tr class="form-field"><th scope="row"><label for="role">Choose a sport</label></th>';
  16.   global $leaguemanager;
  17.   echo '<td><select size="1" name="sport[noofplayers]" id="choose-sport">';
  18.       foreach ( $leaguemanager->getNoOfPlayers() AS $id => $players ) :
  19.         foreach ( $leaguemanager->getLeagueTypes() AS $ID => $title ) :
  20.           if ($id == $ID) {
  21.             $name = $title;
  22.             echo '<option value='.$players.'>'.$title.'</option>';
  23.           }
  24.         endforeach;
  25.       endforeach;
  26.           echo '</select></td></tr></tbody></table>';
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement