Prevent box score output when empty
This commit is contained in:
@@ -29,9 +29,7 @@ if ( ! isset( $id ) )
|
|||||||
$teams = get_post_meta( $id, 'sp_team', false );
|
$teams = get_post_meta( $id, 'sp_team', false );
|
||||||
|
|
||||||
if ( is_array( $teams ) ):
|
if ( is_array( $teams ) ):
|
||||||
?>
|
ob_start();
|
||||||
<div class="sp-event-performance-tables sp-event-performance-teams">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$event = new SP_Event( $id );
|
$event = new SP_Event( $id );
|
||||||
$performance = $event->performance();
|
$performance = $event->performance();
|
||||||
@@ -275,7 +273,16 @@ if ( is_array( $teams ) ):
|
|||||||
}
|
}
|
||||||
|
|
||||||
do_action( 'sportspress_event_performance' );
|
do_action( 'sportspress_event_performance' );
|
||||||
?>
|
|
||||||
</div><!-- .sp-event-performance-tables -->
|
$content = ob_get_clean();
|
||||||
<?php
|
|
||||||
|
$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;
|
endif;
|
||||||
|
|||||||
Reference in New Issue
Block a user