Force future event permalinks

This commit is contained in:
Brian Miyaji
2015-04-25 18:37:27 +10:00
parent 4d69291060
commit 6b06aa0995
5 changed files with 19 additions and 19 deletions

View File

@@ -32,7 +32,7 @@ extract( $defaults, EXTR_SKIP );
if ( ! isset( $post ) ) return;
$title = $post->post_title;
if ( $link_events ) $title = '<a href="' . get_permalink( $post->ID ) . '">' . $title . '</a>';
if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false, true ) . '">' . $title . '</a>';
?>
<div class="sp-template sp-template-countdown">
<div class="sp-countdown-wrapper">

View File

@@ -79,7 +79,7 @@ if ( $show_title && $id ) {
$j++;
if ( has_post_thumbnail ( $team ) ):
if ( $link_teams ):
$logo = '<a class="team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) . '" href="' . get_post_permalink( $team ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon' ) . '</a>';
$logo = '<a class="team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) . '" href="' . get_post_permalink( $team, false, true ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon' ) . '</a>';
else:
$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) );
endif;
@@ -122,7 +122,7 @@ if ( $show_title && $id ) {
<?php endif; endif; ?>
<h4 class="sp-event-title">
<?php if ( $link_events ): ?>
<a href="<?php echo get_post_permalink( $event ); ?>"><?php echo $event->post_title; ?></a>
<a href="<?php echo get_post_permalink( $event, false, true ); ?>"><?php echo $event->post_title; ?></a>
<?php else: ?>
<?php echo $event->post_title; ?>
<?php endif; ?>

View File

@@ -201,7 +201,7 @@ for ( $day = 1; $day <= $daysinmonth; ++$day ) {
$calendar_output .= '<td>';
if ( array_key_exists($day, $daywithpost) ) // any posts today?
$calendar_output .= '<a data-tooltip data-options="disable_for_touch:true" class="has-tip" href="' . ( sizeof( $daywithpost[ $day ] ) > 1 ? add_query_arg( array( 'post_type' => 'sp_event' ), get_day_link( $thisyear, $thismonth, $day ) ) . '" title="' . sprintf( '%s events', ( sizeof( $daywithpost[ $day ] ) ) ) : get_permalink( $daywithpost[ $day ][0] ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) ) . "\">$day</a>";
$calendar_output .= '<a data-tooltip data-options="disable_for_touch:true" class="has-tip" href="' . ( sizeof( $daywithpost[ $day ] ) > 1 ? add_query_arg( array( 'post_type' => 'sp_event' ), get_day_link( $thisyear, $thismonth, $day ) ) . '" title="' . sprintf( '%s events', ( sizeof( $daywithpost[ $day ] ) ) ) : get_post_permalink( $daywithpost[ $day ][0], false, true ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) ) . "\">$day</a>";
else
$calendar_output .= $day;
$calendar_output .= '</td>';

View File

@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
* @version 1.6.1
* @version 1.8.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -184,7 +184,7 @@ if ( $show_title && $id ) {
$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 );
if ( $link_events ) $date_html = '<a href="' . get_permalink( $event->ID ) . '">' . $date_html . '</a>';
if ( $link_events ) $date_html = '<a href="' . get_post_permalink( $event->ID, false, true ) . '">' . $date_html . '</a>';
echo '<td class="data-date">' . $date_html . '</td>';
@@ -196,7 +196,7 @@ if ( $show_title && $id ) {
if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
echo '<td class="data-time">';
if ( $link_events ) echo '<a href="' . get_permalink( $event->ID ) . '">';
if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
if ( ! empty( $main_results ) ):
echo implode( ' - ', $main_results );
else:
@@ -206,7 +206,7 @@ if ( $show_title && $id ) {
echo '</td>';
} elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
echo '<td class="data-results">';
if ( $link_events ) echo '<a href="' . get_permalink( $event->ID ) . '">';
if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
if ( ! empty( $main_results ) ):
echo implode( ' - ', $main_results );
else:
@@ -221,7 +221,7 @@ if ( $show_title && $id ) {
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_permalink( $event->ID ) . '">';
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 );
if ( $link_events ) echo '</a>';
echo '</td>';
@@ -234,7 +234,7 @@ if ( $show_title && $id ) {
echo '<td class="data-event data-teams">' . $teams_output . '</td>';
} else {
$title_html = implode( ' ', $team_logos ) . ' ' . $event->post_title;
if ( $link_events ) $title_html = '<a href="' . get_permalink( $event->ID ) . '">' . $title_html . '</a>';
if ( $link_events ) $title_html = '<a href="' . get_post_permalink( $event->ID, false, true ) . '">' . $title_html . '</a>';
echo '<td class="data-event">' . $title_html . '</td>';
}
}
@@ -243,14 +243,14 @@ if ( $show_title && $id ) {
case 'separate':
if ( sp_column_active( $usecolumns, 'time' ) ) {
echo '<td class="data-time">';
if ( $link_events ) echo '<a href="' . get_permalink( $event->ID ) . '">';
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 );
if ( $link_events ) echo '</a>';
echo '</td>';
}
if ( sp_column_active( $usecolumns, 'results' ) ) {
echo '<td class="data-results">';
if ( $link_events ) echo '<a href="' . get_permalink( $event->ID ) . '">';
if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
if ( ! empty( $main_results ) ):
echo implode( ' - ', $main_results );
else:
@@ -263,7 +263,7 @@ if ( $show_title && $id ) {
case 'time':
if ( sp_column_active( $usecolumns, 'time' ) ) {
echo '<td class="data-time">';
if ( $link_events ) echo '<a href="' . get_permalink( $event->ID ) . '">';
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 );
if ( $link_events ) echo '</a>';
echo '</td>';
@@ -272,7 +272,7 @@ if ( $show_title && $id ) {
case 'results':
if ( sp_column_active( $usecolumns, 'results' ) ) {
echo '<td class="data-results">';
if ( $link_events ) echo '<a href="' . get_permalink( $event->ID ) . '">';
if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
if ( ! empty( $main_results ) ):
echo implode( ' - ', $main_results );
else:
@@ -285,7 +285,7 @@ if ( $show_title && $id ) {
default:
if ( sp_column_active( $usecolumns, 'time' ) ) {
echo '<td class="data-time">';
if ( $link_events ) echo '<a href="' . get_permalink( $event->ID ) . '">';
if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
if ( ! empty( $main_results ) ):
echo implode( ' - ', $main_results );
else:
@@ -330,7 +330,7 @@ if ( $show_title && $id ) {
if ( sp_column_active( $usecolumns, 'article' ) ):
echo '<td class="data-article">';
if ( $link_events ) echo '<a href="' . get_permalink( $event->ID ) . '">';
if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
if ( $video ):
echo '<div class="dashicons dashicons-video-alt"></div>';