Add ability to link teams and limit list
Limit player list to current team players
This commit is contained in:
@@ -51,6 +51,10 @@ class SP_Meta_Box_List_Data {
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th><?php _e( 'Player', 'sportspress' ); ?></th>
|
||||
<th><label for="sp_columns_team">
|
||||
<input type="checkbox" name="sp_columns[]" value="team" id="sp_columns_team" <?php checked( ! is_array( $usecolumns ) || in_array( 'team', $usecolumns ) ); ?>>
|
||||
<?php _e( 'Team', 'sportspress' ); ?>
|
||||
</label></th>
|
||||
<?php foreach ( $columns as $key => $label ): ?>
|
||||
<th><label for="sp_columns_<?php echo $key; ?>">
|
||||
<input type="checkbox" name="sp_columns[]" value="<?php echo $key; ?>" id="sp_columns_<?php echo $key; ?>" <?php checked( ! is_array( $usecolumns ) || in_array( $key, $usecolumns ) ); ?>>
|
||||
@@ -65,6 +69,7 @@ class SP_Meta_Box_List_Data {
|
||||
$i = 0;
|
||||
foreach ( $data as $player_id => $player_stats ):
|
||||
if ( !$player_id ) continue;
|
||||
$team = get_post_meta( $player_id, 'sp_team', true );
|
||||
$div = get_term( $player_id, 'sp_season' );
|
||||
$number = get_post_meta( $player_id, 'sp_number', true );
|
||||
|
||||
@@ -85,6 +90,7 @@ class SP_Meta_Box_List_Data {
|
||||
<a class="button button-primary sp-save"><?php _e( 'Save', 'sportspress' ); ?></a>
|
||||
</span>
|
||||
</td>
|
||||
<td><?php echo get_the_title( $team ); ?></td>
|
||||
<?php foreach( $columns as $column => $label ):
|
||||
$value = sp_array_value( $player_stats, $column, '' );
|
||||
$placeholder = sp_array_value( sp_array_value( $placeholders, $player_id, array() ), $column, 0 );
|
||||
|
||||
@@ -102,7 +102,7 @@ class SP_Meta_Box_List_Details {
|
||||
</p>
|
||||
<p><strong><?php _e( 'Players', 'sportspress' ); ?></strong></p>
|
||||
<?php
|
||||
sp_post_checklist( $post->ID, 'sp_player', 'block', 'sp_team' );
|
||||
sp_post_checklist( $post->ID, 'sp_player', 'block', 'sp_current_team' );
|
||||
sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
@@ -60,6 +60,14 @@ class SP_Settings_Players extends SP_Settings_Page {
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
|
||||
array(
|
||||
'title' => __( 'Teams', 'sportspress' ),
|
||||
'desc' => __( 'Link teams', 'sportspress' ),
|
||||
'id' => 'sportspress_list_link_teams',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
|
||||
array(
|
||||
'title' => __( 'Pagination', 'sportspress' ),
|
||||
'desc' => __( 'Paginate', 'sportspress' ),
|
||||
|
||||
Reference in New Issue
Block a user