Hide visibility option from player performance edit screen if auto
This commit is contained in:
@@ -39,10 +39,6 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
|
||||
if ( '' === $format ) {
|
||||
$format = 'number';
|
||||
}
|
||||
$visible = get_post_meta( $post->ID, 'sp_visible', true );
|
||||
if ( '' === $visible ) {
|
||||
$visible = 1;
|
||||
}
|
||||
?>
|
||||
<p><strong><?php _e( 'Variable', 'sportspress' ); ?></strong></p>
|
||||
<p>
|
||||
@@ -71,6 +67,13 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
|
||||
?>
|
||||
</select>
|
||||
</p>
|
||||
<?php
|
||||
if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
|
||||
$visible = get_post_meta( $post->ID, 'sp_visible', true );
|
||||
if ( '' === $visible ) {
|
||||
$visible = 1;
|
||||
}
|
||||
?>
|
||||
<p>
|
||||
<strong><?php _e( 'Visible', 'sportspress' ); ?></strong>
|
||||
<i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'Display in player profile?', 'sportspress' ); ?>"></i>
|
||||
@@ -91,6 +94,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save meta box data
|
||||
@@ -99,6 +103,8 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
|
||||
self::delete_duplicate( $_POST );
|
||||
update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1 ) );
|
||||
update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) );
|
||||
if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
|
||||
update_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user