Give an option to show or not the event status in countdown widget

This commit is contained in:
savvasha
2021-03-31 12:52:46 +03:00
parent 775ac5cb2f
commit 3203f092f2
2 changed files with 21 additions and 10 deletions

View File

@@ -110,13 +110,18 @@ if ( $title )
$title = $post->post_title;
if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false, true ) . '">' . $title . '</a>';
$sp_status = get_post_meta($post->ID, 'sp_status', true);
$statuses = apply_filters( 'sportspress_event_statuses', array(
'ok' => __( 'On time', 'sportspress' ),
'tbd' => __( 'TBD', 'sportspress' ),
'postponed' => __( 'Postponed', 'sportspress' ),
'cancelled' => __( 'Canceled', 'sportspress' ),
) );
if ( $show_status ) {
$sp_status = get_post_meta($post->ID, 'sp_status', true);
$statuses = apply_filters( 'sportspress_event_statuses', array(
'ok' => __( 'On time', 'sportspress' ),
'tbd' => __( 'TBD', 'sportspress' ),
'postponed' => __( 'Postponed', 'sportspress' ),
'cancelled' => __( 'Canceled', 'sportspress' ),
) );
$title = $title.' ('.$statuses[ $sp_status ].')';
}
?>
<div class="sp-template sp-template-countdown">
<div class="sp-countdown-wrapper">
@@ -147,7 +152,7 @@ $statuses = apply_filters( 'sportspress_event_statuses', array(
}
}
?>
<?php echo $title.' ('.$statuses[ $sp_status ].')'; ?>
<?php echo $title; ?>
</h3>
<?php
if ( isset( $show_date ) && $show_date ):