Display performance column only if positions exist

This commit is contained in:
Brian Miyaji
2015-09-17 17:03:20 +10:00
parent 93e9a2e18f
commit af7dea5ac0
2 changed files with 43 additions and 27 deletions

View File

@@ -114,7 +114,9 @@ class SP_Event extends SP_Custom_Post{
return array( $labels, $columns, $performance, $teams );
else:
// Add position to performance labels
$labels = array_merge( array( 'position' => __( 'Position', 'sportspress' ) ), $labels );
if ( taxonomy_exists( 'sp_position' ) ):
$labels = array_merge( array( 'position' => __( 'Position', 'sportspress' ) ), $labels );
endif;
if ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) && is_array( $columns ) ):
foreach ( $labels as $key => $label ):
if ( ! in_array( $key, $columns ) ):