Add option to display full time in event details

This commit is contained in:
Brian Miyaji
2016-09-01 22:40:56 +10:00
parent 12ce980821
commit 9fd6ed0d51
2 changed files with 19 additions and 3 deletions

View File

@@ -65,7 +65,7 @@ class SP_Settings_Events extends SP_Settings_Page {
array( 'type' => 'event_tabs' ),
array(
'title' => __( 'Display', 'sportspress' ),
'title' => __( 'Details', 'sportspress' ),
'desc' => __( 'Date', 'sportspress' ),
'id' => 'sportspress_event_show_date',
'default' => 'yes',
@@ -86,6 +86,14 @@ class SP_Settings_Events extends SP_Settings_Page {
'id' => 'sportspress_event_show_day',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => '',
),
array(
'desc' => __( 'Full Time', 'sportspress' ),
'id' => 'sportspress_event_show_full_time',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
),
) ),
@@ -380,8 +388,8 @@ class SP_Settings_Events extends SP_Settings_Page {
),
array(
'desc' => __( 'Time', 'sportspress' ),
'id' => 'sportspress_event_performance_show_time',
'desc' => __( 'Minutes', 'sportspress' ),
'id' => 'sportspress_event_performance_show_minutes',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end',

View File

@@ -45,6 +45,14 @@ if ( 'yes' === get_option( 'sportspress_event_show_day', 'yes' ) ) {
}
}
if ( 'yes' === get_option( 'sportspress_event_show_full_time', 'yes' ) ) {
$full_time = get_post_meta( $id, 'sp_minutes', true );
if ( '' === $full_time ) {
$full_time = get_option( 'sportspress_minutes', 90 );
}
$data[ __( 'Full Time', 'sportspress' ) ] = $full_time . '\'';
}
$data = apply_filters( 'sportspress_event_details', $data, $id );
if ( ! sizeof( $data ) ) return;