title: Wordpress Plugin/League Manager
body: <p>I downloaded and installed a Wordpress plugin. Essentially it's a standings/league manager plugin. The problem is that I can only schedule league games and not out of league games for a team. Would it be possible to add something in this function.php to allow me to add out of league matches? If so, could somebody help me do it?</p>
  
  <p>The function.php is:</p>
  
  <pre><code>    &lt;?php
  /**
   * display widget statically
   *
   * @param int $number
   * @param array $instance
   */
  function leaguemanager_display_widget( $number, $instance ) {
      echo "&lt;ul id='leaguemanger-widget-".$instance['league']."' class='leaguemanager_widget'&gt;";
      $widget = new LeagueManagerWidget(true);
      $widget-&gt;widget( array('number' =&gt; $number), $instance );
      echo "&lt;/ul&gt;";
  }
  
  
  /**
   * display next match box
   *
   * @param int $number
   * @param array $instance
   */
  function leaguemanager_display_next_match_box( $number, $instance ) {
      $widget = new LeagueManagerWidget(true);
      $widget-&gt;showNextMatchBox( $number, $instance );
  }
  
  
  /**
   * display previous match box
   *
   * @param int $number
   * @param array $instance
   */
  function leaguemanager_display_prev_match_box( $number, $instance ) {
      $widget = new LeagueManagerWidget(true);
      $widget-&gt;showPrevMatchBox( $number, $instance );
  }
  
  
  /**
   * display standings table manually
   *
   * @param int $league_id League ID
   * @param array $args assoziative array of parameters, see default values (optional)
   * @return void
   */
  function leaguemanager_standings( $league_id, $args = array() ) {
      global $lmShortcodes;
      $defaults = array( 'season' =&gt; false, 'template' =&gt; 'extend', 'logo' =&gt; 'true', 'group' =&gt; false, 'home' =&gt; false );
      $args = array_merge($defaults, $args);
      extract($args, EXTR_SKIP);
      echo $lmShortcodes-&gt;showStandings( array('league_id' =&gt; $league_id, 'logo' =&gt; $logo, 'season' =&gt; $season, 'template' =&gt; $template, 'group' =&gt; $group, 'home' =&gt; $home) );
  }
  
  
  /**
   * display crosstable table manually
   *
   * @param int $league_id
   * @param array $args assoziative array of parameters, see default values (optional)
   * @return void
   */
  function leaguemanager_crosstable( $league_id, $args = array() ) {
      global $lmShortcodes;
      $defaults = array('season' =&gt; false, 'template' =&gt; '', 'mode' =&gt; '');
      $args = array_merge($defaults, $args);
      extract($args, EXTR_SKIP);
      echo $lmShortcodes-&gt;showCrosstable( array('league_id' =&gt; $league_id, 'mode' =&gt; $mode, 'template' =&gt; $temaplate, 'season' =&gt; $season) );
  }
  
  
  /**
   * display matches table manually
   *
   * @param int $league_id
   * @param array $args assoziative array of parameters, see default values (optional)
   * @return void
   */
  function leaguemanager_matches( $league_id, $args = array() ) {
      global $lmShortcodes;
      $defaults = array('season' =&gt; false, 'template' =&gt; '', 'mode' =&gt; '', 'archive' =&gt; false, 'match_day' =&gt; false, 'group' =&gt; false, 'roster' =&gt; false, 'order' =&gt; false);
      $args = array_merge($defaults, $args);
      extract($args, EXTR_SKIP);
      echo $lmShortcodes-&gt;showMatches( array('league_id' =&gt; $league_id, 'mode' =&gt; $mode, 'season' =&gt; $season, 'archive' =&gt; $archive, 'template' =&gt; $template, 'roster' =&gt; $roster, 'order' =&gt; $order, 'match_day' =&gt; $match_day, 'group' =&gt; $group) );
  }
  
  
  /**
   * display one match manually
   *
   * @param int $match_id
   * @param array $args additional arguments as assoziative array (optional)
   * @return void
   */
  function leaguemanager_match( $match_id, $args = array() ) {
      global $lmShortcodes;
      $defaults = array('template' =&gt; '');
      $args = array_merge($defaults, $args);
      extract($args, EXTR_SKIP);
  
      echo $lmShortcodes-&gt;showMatch( array('id' =&gt; $match_id, 'template' =&gt; $template) );
  }
  
  
  /**
   * display team list manually
   *
   * @param int|string $league_id
   * @param array $args additional arguments as assoziative array (optional)
   * @return void
   */
  function leaguemanager_teams( $league_id, $args = array() ) {
      global $lmShortcodes;
      $defaults = array('season' =&gt; false, 'template' =&gt; '');
      $args = array_merge($defaults, $args);
      extract($args, EXTR_SKIP);
  
      echo $lmShortcodes-&gt;showTeams( array('league_id' =&gt; $league_id, 'season' =&gt; $season, 'template' =&gt; $template) );
  }
  
  
  /**
   * display one team manually
   *
   * @param int $team_id
   * @param array $args additional arguments as assoziative array (optional)
   * @return void
   */
  function leaguemanager_team( $team_id, $args = array() ) {
      global $lmShortcodes;
      $defaults = array('template' =&gt; '');
      $args = array_merge($defaults, $args);
      extract($args, EXTR_SKIP);
  
      echo $lmShortcodes-&gt;showTeam( array('id' =&gt; $team_id, 'template' =&gt; $template) );
  }
  
  
  /**
   * display championchip manually
   *
   * @param int $league_id
   * @param array $args additional arguments as assoziative array (optional)
   * @return void
   */
  function leaguemanager_championship( $league_id, $args = array() ) {
      global $lmShortcodes;
      $defaults = array('template' =&gt; '', 'season' =&gt; false);
      $args = array_merge($defaults, $args);
      extract($args, EXTR_SKIP);
  
      echo $lmShortcodes-&gt;showChampionship( array('league_id' =&gt; $league_id, 'template' =&gt; $template, 'season' =&gt; $season) );
  }
  
  
  /**
   * helper function to allocate matches and teams of a league to a aseason and maybe other league
   *
   * @param int $league_id ID of current league
   * @param string $season season to set
   * @param int $new_league_id ID of different league to add teams and matches to (optionl)
   * @param int $old_season (optional) old season if you want to re-allocate teams and matches
   */
  function move_league_to_season( $league_id, $season, $new_league_id = false, $old_season = false ) {
      global $leaguemanager, $wpdb;
      if ( !$new_league_id ) $new_league_id = $league_id;
  
      $search = "`league_id` = '".$league_id."'";
      if ( $old_season ) $search .= " AND `season` = '".$old_season."'";
  
      if ( $teams = $leaguemanager-&gt;getTeams($search) ) {
          foreach ( $teams AS $team ) {
              $wpdb-&gt;query( $wpdb-&gt;prepare( "UPDATE {$wpdb-&gt;leaguemanager_teams} SET `season` = '%d', `league_id` = '%d' WHERE `id` = '%d'", $season, $new_league_id, $team-&gt;id ) );
          }
      }
      if ( $matches = $leaguemanager-&gt;getMatches($search) ) {
          foreach ( $matches AS $match ) {
              $wpdb-&gt;query( $wpdb-&gt;prepare( "UPDATE {$wpdb-&gt;leaguemanager_matches} SET `season` = '%d', `league_id` = '%d' WHERE `id` = '%d'", $season, $new_league_id, $match-&gt;id ) );
          }
      }
  }
  
  ?&gt;
  </code></pre>