Prevent box score output when empty

This commit is contained in:
Brian Miyaji
2016-09-22 13:33:47 +10:00
parent 8a264e499b
commit f736c9fb6f

View File

@@ -29,9 +29,7 @@ if ( ! isset( $id ) )
$teams = get_post_meta( $id, 'sp_team', false );
if ( is_array( $teams ) ):
?>
<div class="sp-event-performance-tables sp-event-performance-teams">
<?php
ob_start();
$event = new SP_Event( $id );
$performance = $event->performance();
@@ -275,7 +273,16 @@ if ( is_array( $teams ) ):
}
do_action( 'sportspress_event_performance' );
?>
</div><!-- .sp-event-performance-tables -->
<?php
$content = ob_get_clean();
$content = trim( $content );
if ( ! empty( $content ) ):
?>
<div class="sp-event-performance-tables sp-event-performance-teams">
<?php echo $content; ?>
</div><!-- .sp-event-performance-tables -->
<?php
endif;
endif;