Add option to display match day in event details
This commit is contained in:
@@ -72,6 +72,7 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'start',
|
'checkboxgroup' => 'start',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Time', 'sportspress' ),
|
'desc' => __( 'Time', 'sportspress' ),
|
||||||
'id' => 'sportspress_event_show_time',
|
'id' => 'sportspress_event_show_time',
|
||||||
@@ -79,6 +80,14 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => '',
|
'checkboxgroup' => '',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Match Day', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_show_day',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end',
|
||||||
|
),
|
||||||
) ),
|
) ),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
@@ -294,7 +303,8 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
array( 'title' => __( 'Box Score', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'performance_options' ),
|
array( 'title' => __( 'Box Score', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'performance_options' ),
|
||||||
),
|
),
|
||||||
|
|
||||||
apply_filters( 'sportspress_performance_options', array(
|
apply_filters( 'sportspress_performance_options', array_merge(
|
||||||
|
array(
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Rows', 'sportspress' ),
|
'title' => __( 'Rows', 'sportspress' ),
|
||||||
'desc' => __( 'Staff', 'sportspress' ),
|
'desc' => __( 'Staff', 'sportspress' ),
|
||||||
@@ -349,7 +359,9 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
apply_filters( 'sportspress_event_performance_display_options', array(
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Display', 'sportspress' ),
|
'title' => __( 'Display', 'sportspress' ),
|
||||||
'desc' => __( 'Squad Number', 'sportspress' ),
|
'desc' => __( 'Squad Number', 'sportspress' ),
|
||||||
@@ -374,7 +386,9 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end',
|
'checkboxgroup' => 'end',
|
||||||
),
|
),
|
||||||
|
) ),
|
||||||
|
|
||||||
|
array(
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Performance', 'sportspress' ),
|
'title' => __( 'Performance', 'sportspress' ),
|
||||||
'id' => 'sportspress_event_performance_sections',
|
'id' => 'sportspress_event_performance_sections',
|
||||||
@@ -397,6 +411,7 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'primary' => __( 'Primary', 'sportspress' ),
|
'primary' => __( 'Primary', 'sportspress' ),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
)
|
||||||
) ),
|
) ),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ foreach ( $taxonomies as $taxonomy => $post_type ):
|
|||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
if ( 'yes' === get_option( 'sportspress_event_show_day', 'yes' ) ) {
|
||||||
|
$day = get_post_meta( $id, 'sp_day', true );
|
||||||
|
if ( '' !== $day ) {
|
||||||
|
$data[ __( 'Match Day', 'sportspress' ) ] = $day;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$data = apply_filters( 'sportspress_event_details', $data, $id );
|
$data = apply_filters( 'sportspress_event_details', $data, $id );
|
||||||
|
|
||||||
if ( ! sizeof( $data ) ) return;
|
if ( ! sizeof( $data ) ) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user