Option to hide total player performance in event
This commit is contained in:
@@ -82,7 +82,7 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Players', 'sportspress' ),
|
'title' => __( 'Player Performance', 'sportspress' ),
|
||||||
'desc' => __( 'Display players', 'sportspress' ),
|
'desc' => __( 'Display players', 'sportspress' ),
|
||||||
'id' => 'sportspress_event_show_players',
|
'id' => 'sportspress_event_show_players',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
@@ -95,6 +95,14 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'id' => 'sportspress_event_link_players',
|
'id' => 'sportspress_event_link_players',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Display total', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_show_total',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end',
|
'checkboxgroup' => 'end',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @package SportsPress/Templates
|
* @package SportsPress/Templates
|
||||||
* @version 1.2
|
* @version 1.2.1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
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 );
|
$players = sp_array_between( (array)get_post_meta( $id, 'sp_player', false ), 0, $index );
|
||||||
$has_players = sizeof( $players ) > 1;
|
$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();
|
$totals = array();
|
||||||
|
|
||||||
$data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );
|
$data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h4 class="sp-table=caption"><?php echo get_the_title( $team_id ); ?></h4>
|
<h4 class="sp-table=caption"><?php echo get_the_title( $team_id ); ?></h4>
|
||||||
<?php
|
<?php
|
||||||
@@ -144,7 +148,7 @@ if ( is_array( $teams ) ):
|
|||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( $status == 'results' && array_key_exists( 0, $data ) ): ?>
|
<?php if ( $status == 'results' && get_option( 'sportspress_event_show_total', 'yes' ) == 'yes' && array_key_exists( 0, $data ) ): ?>
|
||||||
<<?php echo ( $show_players && $has_players ? 'tfoot' : 'tbody' ); ?>>
|
<<?php echo ( $show_players && $has_players ? 'tfoot' : 'tbody' ); ?>>
|
||||||
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
Reference in New Issue
Block a user