diff --git a/modules/sportspress-calendars.php b/modules/sportspress-calendars.php index 9a0605c7..3a2afda4 100644 --- a/modules/sportspress-calendars.php +++ b/modules/sportspress-calendars.php @@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/ Description: Add event calendars to SportsPress. Author: ThemeBoy Author URI: http://themeboy.com/ -Version: 2.0 +Version: 2.0.7 */ // Exit if accessed directly @@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Calendars' ) ) : * Main SportsPress Calendars Class * * @class SportsPress_Calendars - * @version 2.0 + * @version 2.0.7 */ class SportsPress_Calendars { @@ -49,7 +49,7 @@ class SportsPress_Calendars { */ private function define_constants() { if ( !defined( 'SP_CALENDARS_VERSION' ) ) - define( 'SP_CALENDARS_VERSION', '2.0' ); + define( 'SP_CALENDARS_VERSION', '2.0.7' ); if ( !defined( 'SP_CALENDARS_URL' ) ) define( 'SP_CALENDARS_URL', plugin_dir_url( __FILE__ ) ); @@ -311,6 +311,14 @@ class SportsPress_Calendars { 'type' => 'checkbox', ), + array( + 'title' => __( 'Teams', 'sportspress' ), + 'desc' => __( 'Display logos', 'sportspress' ), + 'id' => 'sportspress_event_blocks_show_logos', + 'default' => 'yes', + 'type' => 'checkbox', + ), + array( 'title' => __( 'Details', 'sportspress' ), 'desc' => __( 'Display competition', 'sportspress' ), diff --git a/readme.txt b/readme.txt index fbba9c90..b2cccae8 100644 --- a/readme.txt +++ b/readme.txt @@ -240,6 +240,7 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate == Changelog == = 2.0.7 = +* Feature - Add option to show or hide logos or photos in event blocks. * Tweak - Combine reverse teams option for results and box score. * Fix - Add filter to template output for extensions. diff --git a/templates/event-blocks.php b/templates/event-blocks.php index 2a4a42af..28cae7d1 100644 --- a/templates/event-blocks.php +++ b/templates/event-blocks.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 2.0 + * @version 2.0.7 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -21,6 +21,7 @@ $defaults = array( 'venue' => null, 'team' => null, 'number' => -1, + 'show_team_logo' => get_option( 'sportspress_event_blocks_show_logos', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false, @@ -91,18 +92,20 @@ if ( $title ) $teams = array_filter( $teams, 'sp_filter_positive' ); $logos = array(); - $j = 0; - foreach( $teams as $team ): - $j++; - if ( has_post_thumbnail ( $team ) ): - if ( $link_teams ): - $logo = ''; - else: - $logo = ''; + if ( $show_team_logo ): + $j = 0; + foreach( $teams as $team ): + $j++; + if ( has_post_thumbnail ( $team ) ): + if ( $link_teams ): + $logo = ''; + else: + $logo = ''; + endif; + $logos[] = $logo; endif; - $logos[] = $logo; - endif; - endforeach; + endforeach; + endif; ?>