From 9324fcfaa0dfa7fec88864ed31514d3e22ba64eb Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 23 Mar 2015 22:02:27 +1100 Subject: [PATCH] Add player statistics to template selector --- .../settings/class-sp-settings-players.php | 23 ++++++++++++++++--- templates/player-statistics.php | 3 ++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/includes/admin/settings/class-sp-settings-players.php b/includes/admin/settings/class-sp-settings-players.php index 24a0f92e..413d7d4a 100644 --- a/includes/admin/settings/class-sp-settings-players.php +++ b/includes/admin/settings/class-sp-settings-players.php @@ -69,9 +69,9 @@ class SP_Settings_Players extends SP_Settings_Page { ), array( - 'desc' => __( 'Career Total', 'sportspress' ), - 'id' => 'sportspress_player_show_total', - 'default' => 'no', + 'desc' => __( 'Statistics', 'sportspress' ), + 'id' => 'sportspress_player_show_statistics', + 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), @@ -98,3 +98,20 @@ class SP_Settings_Players extends SP_Settings_Page { endif; return new SP_Settings_Players(); + +/* +array( + 'title' => __( 'Templates', 'sportspress' ), + 'type' => 'templates', + 'options' => array( + 'details' => array( + 'title' => __( 'Details', 'sportspress' ), + 'default' => 'yes', + ), + 'statistics' => array( + 'title' => __( 'Statistics', 'sportspress' ), + 'default' => 'yes', + ), + ), +), +*/ \ No newline at end of file diff --git a/templates/player-statistics.php b/templates/player-statistics.php index 8e50c508..6be98d9b 100644 --- a/templates/player-statistics.php +++ b/templates/player-statistics.php @@ -4,10 +4,11 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 1.6 + * @version 1.7.3 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if ( get_option( 'sportspress_player_show_statistics', 'yes' ) === 'no' ) return; if ( ! isset( $id ) ) $id = get_the_ID();