Display checklist only when needed

This commit is contained in:
Brian Miyaji
2015-09-27 12:19:27 +10:00
parent 1bbf4ac962
commit a10aab6a70
3 changed files with 8 additions and 10 deletions

View File

@@ -91,8 +91,10 @@ class SP_Meta_Box_List_Details {
</select>
</p>
<?php
sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season', 'sp_current_team' ) );
sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
if ( 'manual' == $select ) {
sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season', 'sp_current_team' ) );
sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
}
?>
</div>
<?php

View File

@@ -43,8 +43,10 @@ class SP_Meta_Box_Table_Details {
</select>
</p>
<?php
sp_post_checklist( $post->ID, 'sp_team', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season' ) );
sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
if ( 'manual' == $select ) {
sp_post_checklist( $post->ID, 'sp_team', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season' ) );
sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
}
?>
</div>
<?php