From 72815b6960dd481fc716832351772bbcca6b5917 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Fri, 13 Feb 2015 18:56:28 +1100 Subject: [PATCH] Add option to show/hide event list title --- modules/sportspress-calendars.php | 8 ++++++++ templates/event-list.php | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/sportspress-calendars.php b/modules/sportspress-calendars.php index afdacd03..f13dc71e 100644 --- a/modules/sportspress-calendars.php +++ b/modules/sportspress-calendars.php @@ -191,6 +191,14 @@ class SportsPress_Calendars { ), apply_filters( 'sportspress_event_list_options', array( + array( + 'title' => __( 'Title', 'sportspress' ), + 'desc' => __( 'Display calendar title', 'sportspress' ), + 'id' => 'sportspress_event_list_show_title', + 'default' => 'yes', + 'type' => 'checkbox', + ), + array( 'title' => __( 'Teams', 'sportspress' ), 'desc' => __( 'Display logos', 'sportspress' ), diff --git a/templates/event-list.php b/templates/event-list.php index 311e6b96..18614718 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -27,6 +27,7 @@ $defaults = array( 'order' => 'default', 'columns' => null, 'show_all_events_link' => false, + 'show_title' => get_option( 'sportspress_event_list_show_title', 'yes' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); @@ -54,7 +55,7 @@ if ( isset( $columns ) ): $usecolumns = explode( ',', $columns ); endif; -if ( $id ) { +if ( $show_title && $id ) { echo '

' . get_the_title( $id ) . '

'; } ?>