Make the Date field optional in Event List template and Shortcode
This commit is contained in:
@@ -29,6 +29,8 @@ class SP_Meta_Box_Calendar_Columns {
|
||||
|
||||
$columns = array();
|
||||
|
||||
$columns['date'] = __( 'Date', 'sportspress' );
|
||||
|
||||
if ( 'teams' === $title_format ) {
|
||||
$columns[ 'event' ] = __( 'Home', 'sportspress' ) . ' | ' . __( 'Away', 'sportspress' );
|
||||
} elseif ( 'homeaway' === $title_format ) {
|
||||
|
||||
@@ -621,6 +621,7 @@ class SP_AJAX {
|
||||
<?php _e( 'Columns:', 'sportspress' ); ?><br>
|
||||
<?php
|
||||
$the_columns = array(
|
||||
'date' => __( 'Date', 'sportspress' ),
|
||||
'event' => __( 'Event', 'sportspress' ),
|
||||
'teams' => __( 'Teams', 'sportspress' ),
|
||||
'time' => __( 'Time', 'sportspress' ),
|
||||
|
||||
@@ -113,7 +113,9 @@ $identifier = uniqid( 'eventlist_' );
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
|
||||
if ( sp_column_active( $usecolumns, 'date' ) ) {
|
||||
echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
|
||||
}
|
||||
|
||||
switch ( $title_format ) {
|
||||
case 'homeaway':
|
||||
@@ -255,7 +257,9 @@ $identifier = uniqid( 'eventlist_' );
|
||||
|
||||
if ( $link_events ) $date_html = '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">' . $date_html . '</a>';
|
||||
|
||||
echo '<td class="data-date" itemprop="startDate" content="' . mysql2date( 'Y-m-d\TH:iP', $event->post_date ) . '" data-label="'.__( 'Date', 'sportspress' ).'">' . $date_html . '</td>';
|
||||
if ( sp_column_active( $usecolumns, 'date' ) ) {
|
||||
echo '<td class="data-date" itemprop="startDate" content="' . mysql2date( 'Y-m-d\TH:iP', $event->post_date ) . '" data-label="'.__( 'Date', 'sportspress' ).'">' . $date_html . '</td>';
|
||||
}
|
||||
|
||||
switch ( $title_format ) {
|
||||
case 'homeaway':
|
||||
|
||||
Reference in New Issue
Block a user