Replace event time with status when not on time

This commit is contained in:
Brian Miyaji
2016-09-09 23:45:43 +10:00
parent 664647dac6
commit 5b3880ba1b
8 changed files with 39 additions and 21 deletions

View File

@@ -191,7 +191,7 @@ if ( $ak_post_titles ) {
foreach ( (array) $ak_post_titles as $ak_post_title ) {
/** This filter is documented in wp-includes/post-template.php */
$post_title = esc_attr( apply_filters( 'the_title', $ak_post_title->post_title, $ak_post_title->ID ) . ' @ ' . date_i18n( get_option( 'time_format' ), strtotime( $ak_post_title->post_date ) ) );
$post_title = esc_attr( apply_filters( 'the_title', $ak_post_title->post_title, $ak_post_title->ID ) . ' @ ' . apply_filters( 'sportspress_event_time', date_i18n( get_option( 'time_format' ), strtotime( $ak_post_title->post_date ) ), $ak_post_title->ID ) );
if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) )
$ak_titles_for_day['day_'.$ak_post_title->dom] = '';

View File

@@ -24,7 +24,7 @@ if ( 'yes' === get_option( 'sportspress_event_show_date', 'yes' ) ) {
if ( 'yes' === get_option( 'sportspress_event_show_time', 'yes' ) ) {
$time = get_the_time( get_option('time_format'), $id );
$data[ __( 'Time', 'sportspress' ) ] = $time;
$data[ __( 'Time', 'sportspress' ) ] = apply_filters( 'sportspress_event_time', $time, $id );
}
$taxonomies = apply_filters( 'sportspress_event_taxonomies', array( 'sp_league' => null, 'sp_season' => null ) );

View File

@@ -209,7 +209,7 @@ endif;
echo '<tr class="sp-row sp-post' . ( $i % 2 == 0 ? ' alternate' : '' ) . ' sp-row-no-' . $i . '">';
$date_html = '<date>' . get_post_time( 'Y-m-d H:i:s', false, $event ) . '</date>' . get_post_time( get_option( 'date_format' ), false, $event, true );
$date_html = '<date>' . get_post_time( 'Y-m-d H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', get_post_time( get_option( 'date_format' ), false, $event, true ), $event->ID );
if ( $link_events ) $date_html = '<a href="' . get_post_permalink( $event->ID, false, true ) . '">' . $date_html . '</a>';
@@ -227,7 +227,7 @@ endif;
if ( ! empty( $main_results ) ):
echo implode( ' - ', $main_results );
else:
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
endif;
if ( $link_events ) echo '</a>';
echo '</td>';
@@ -249,7 +249,7 @@ endif;
if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
echo '<td class="data-time">';
if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
if ( $link_events ) echo '</a>';
echo '</td>';
}
@@ -271,7 +271,7 @@ endif;
if ( sp_column_active( $usecolumns, 'time' ) ) {
echo '<td class="data-time">';
if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
if ( $link_events ) echo '</a>';
echo '</td>';
}
@@ -291,7 +291,7 @@ endif;
if ( sp_column_active( $usecolumns, 'time' ) ) {
echo '<td class="data-time">';
if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
if ( $link_events ) echo '</a>';
echo '</td>';
}
@@ -316,7 +316,7 @@ endif;
if ( ! empty( $main_results ) ):
echo implode( ' - ', $main_results );
else:
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
endif;
if ( $link_events ) echo '</a>';
echo '</td>';

View File

@@ -50,7 +50,7 @@
if ( $show_time ) {
?>
<h5 class="sp-event-results">
<?php echo '<span class="sp-result">' . apply_filters( 'sportspress_event_blocks_team_result_or_time', sp_get_time( $id ), $id ) . '</span>'; ?>
<?php echo '<span class="sp-result">' . apply_filters( 'sportspress_event_time', sp_get_time( $id ), $id ) . '</span>'; ?>
</h5>
<span class="sp-event-status">
<?php _e( 'Preview', 'sportspress' ); ?>

View File

@@ -53,7 +53,7 @@ if ( ! empty( $team_logos ) ):
// Assign delimiter
if ( $show_time && sizeof( $teams ) <= 2 ) {
$delimiter = '<strong class="sp-event-logos-time sp-team-result">' . get_the_time( get_option('time_format'), $id ) . '</strong>';
$delimiter = '<strong class="sp-event-logos-time sp-team-result">' . apply_filters( 'sportspress_event_time', get_the_time( get_option('time_format'), $id ), $id ) . '</strong>';
} else {
$delimiter = get_option( 'sportspress_event_teams_delimiter', 'vs' );
}