Add option to display full time in event details
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user