diff --git a/includes/admin/settings/class-sp-settings-events.php b/includes/admin/settings/class-sp-settings-events.php index 6afa7102..287dc65e 100644 --- a/includes/admin/settings/class-sp-settings-events.php +++ b/includes/admin/settings/class-sp-settings-events.php @@ -82,7 +82,7 @@ class SP_Settings_Events extends SP_Settings_Page { ), array( - 'title' => __( 'Players', 'sportspress' ), + 'title' => __( 'Player Performance', 'sportspress' ), 'desc' => __( 'Display players', 'sportspress' ), 'id' => 'sportspress_event_show_players', 'default' => 'yes', @@ -95,6 +95,14 @@ class SP_Settings_Events extends SP_Settings_Page { 'id' => 'sportspress_event_link_players', 'default' => 'yes', 'type' => 'checkbox', + 'checkboxgroup' => '', + ), + + array( + 'desc' => __( 'Display total', 'sportspress' ), + 'id' => 'sportspress_event_show_total', + 'default' => 'yes', + 'type' => 'checkbox', 'checkboxgroup' => 'end', ), diff --git a/templates/event-performance.php b/templates/event-performance.php index 9a6386ee..cedf557d 100644 --- a/templates/event-performance.php +++ b/templates/event-performance.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 1.2 + * @version 1.2.1 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -39,11 +39,15 @@ if ( is_array( $teams ) ): $players = sp_array_between( (array)get_post_meta( $id, 'sp_player', false ), 0, $index ); $has_players = sizeof( $players ) > 1; - if ( ! $has_players && $status != 'results' ) continue; + if ( ! $has_players ): + if ( $status != 'results' ) continue; + elseif ( get_option( 'sportspress_event_show_total', 'yes' ) != 'yes' ) continue; + endif; $totals = array(); $data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) ); + ?>

- + <>