flip flopping home and away?

This commit is contained in:
2026-02-20 17:19:46 -06:00
parent ccc6c1877d
commit 8406699b93

View File

@@ -152,7 +152,7 @@ $identifier = uniqid( 'eventlist_' );
switch ( $title_format ) { switch ( $title_format ) {
case 'homeaway': case 'homeaway':
if ( sp_column_active( $usecolumns, 'event' ) ) { if ( sp_column_active( $usecolumns, 'event' ) ) {
echo '<th class="data-home">' . esc_attr__( 'Home', 'sportspress' ) . '</th>'; echo '<th class="data-away">' . esc_attr__( 'Away', 'sportspress' ) . '</th>';
} }
if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) { if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
@@ -163,7 +163,7 @@ $identifier = uniqid( 'eventlist_' );
} }
if ( sp_column_active( $usecolumns, 'event' ) ) { if ( sp_column_active( $usecolumns, 'event' ) ) {
echo '<th class="data-away">' . esc_attr__( 'Away', 'sportspress' ) . '</th>'; echo '<th class="data-home">' . esc_attr__( 'Home', 'sportspress' ) . '</th>';
} }
if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) { if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
@@ -322,9 +322,13 @@ $identifier = uniqid( 'eventlist_' );
switch ( $title_format ) { switch ( $title_format ) {
case 'homeaway': case 'homeaway':
$away_team = null;
$home_team = null;
if ( sp_column_active( $usecolumns, 'event' ) ) { if ( sp_column_active( $usecolumns, 'event' ) ) {
$team = array_shift( $teams_array ); $away_team = array_shift( $teams_array );
echo '<td class="data-home' . esc_attr( $team_class ) . '" itemprop="competitor" itemscope itemtype="http://schema.org/SportsTeam" data-label="' . esc_attr__( 'Home', 'sportspress' ) . '">' . wp_kses_post( $team ) . '</td>'; $home_team = array_shift( $teams_array );
echo '<td class="data-away' . esc_attr( $team_class ) . '" itemprop="competitor" itemscope itemtype="http://schema.org/SportsTeam" data-label="' . esc_attr__( 'Away', 'sportspress' ) . '">' . wp_kses_post( $away_team ) . '</td>';
} }
if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) { if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
@@ -358,8 +362,7 @@ $identifier = uniqid( 'eventlist_' );
} }
if ( sp_column_active( $usecolumns, 'event' ) ) { if ( sp_column_active( $usecolumns, 'event' ) ) {
$team = array_shift( $teams_array ); echo '<td class="data-home' . esc_attr( $team_class ) . '" itemprop="competitor" itemscope itemtype="http://schema.org/SportsTeam" data-label="' . esc_attr__( 'Home', 'sportspress' ) . '">' . wp_kses_post( $home_team ) . '</td>';
echo '<td class="data-away' . esc_attr( $team_class ) . '" itemprop="competitor" itemscope itemtype="http://schema.org/SportsTeam" data-label="' . esc_attr__( 'Away', 'sportspress' ) . '">' . wp_kses_post( $team ) . '</td>';
} }
if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) { if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {