diff --git a/assets/css/sportspress.css b/assets/css/sportspress.css index 0ec66c6d..34782217 100644 --- a/assets/css/sportspress.css +++ b/assets/css/sportspress.css @@ -448,6 +448,10 @@ clear: both; } +span.sp_event_spec_label { + font-weight: bold; +} + /* Event Logos Block */ .sp-template-event-logos-block .team-logo { float: none; diff --git a/modules/sportspress-event-specs.php b/modules/sportspress-event-specs.php index 69277bac..e973dc37 100644 --- a/modules/sportspress-event-specs.php +++ b/modules/sportspress-event-specs.php @@ -34,6 +34,7 @@ class SportsPress_Event_Specs { add_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) ); add_action( 'sportspress_event_list_head_row', array( $this, 'event_list_head_row' ), 11 ); add_action( 'sportspress_event_list_row', array( $this, 'event_list_row' ), 11, 2 ); + add_action( 'sportspress_event_blocks_after', array( $this, 'event_blocks_after' ), 11, 2 ); // Filters add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) ); @@ -230,7 +231,7 @@ class SportsPress_Event_Specs { * Event list head row. */ public function event_list_head_row( $usecolumns = array() ) { - if ( is_array( $usecolumns ) && in_array( 'event_specs', $usecolumns ) ) { + if ( sp_column_active( $usecolumns, 'event_specs' ) ) { $spec_labels = (array)sp_get_var_labels( 'sp_spec', null, false ); if ( empty( $spec_labels ) ) return; @@ -249,7 +250,7 @@ class SportsPress_Event_Specs { * Event list row. */ public function event_list_row( $event, $usecolumns = array() ) { - if ( is_array( $usecolumns ) && in_array( 'event_specs', $usecolumns ) ) { + if ( sp_column_active( $usecolumns, 'event_specs' ) ) { $event = new SP_Event( $event ); $specs = $event->specs( false ); $spec_labels = (array)sp_get_var_labels( 'sp_spec', null, false ); @@ -267,6 +268,20 @@ class SportsPress_Event_Specs { } } } + + /** + * Add Event Specs after default template of Event blocks is loaded. + */ + public function event_blocks_after( $event, $usecolumns = array() ) { + if ( sp_column_active( $usecolumns, 'event_specs' ) ) { + $event = new SP_Event( $event ); + $specs = $event->specs( false ); + $spec_labels = (array)sp_get_var_labels( 'sp_spec', null, false ); + foreach ( $specs as $spec_label => $spec_value ) { + echo '