Use preg_replace to remove leading zero from timed statistic
This commit is contained in:
@@ -427,7 +427,7 @@ class SP_Meta_Box_Event_Performance {
|
|||||||
if ( '00' != $hours )
|
if ( '00' != $hours )
|
||||||
$timeval = $hours . ':' . $timeval;
|
$timeval = $hours . ':' . $timeval;
|
||||||
|
|
||||||
$timeval = ereg_replace( '^0', '', $timeval );
|
$timeval = preg_replace( '/^0/', '', $timeval );
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<input class="sp-player-<?php echo $column; ?>-input sp-convert-time-input sp-sync-input" type="text" name="sp_times[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $timeval ); ?>" placeholder="<?php echo $placeholder; ?>" />
|
<input class="sp-player-<?php echo $column; ?>-input sp-convert-time-input sp-sync-input" type="text" name="sp_times[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $timeval ); ?>" placeholder="<?php echo $placeholder; ?>" />
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ class SP_Meta_Box_Player_Statistics {
|
|||||||
if ( '00' != $hours )
|
if ( '00' != $hours )
|
||||||
$timeval = $hours . ':' . $timeval;
|
$timeval = $hours . ':' . $timeval;
|
||||||
|
|
||||||
$timeval = ereg_replace( '^0', '', $timeval );
|
$timeval = preg_replace( '/^0/', '', $timeval );
|
||||||
|
|
||||||
// Convert placeholder
|
// Convert placeholder
|
||||||
$intval = intval( $placeholder );
|
$intval = intval( $placeholder );
|
||||||
@@ -210,7 +210,7 @@ class SP_Meta_Box_Player_Statistics {
|
|||||||
if ( '00' != $hours )
|
if ( '00' != $hours )
|
||||||
$placeholder = $hours . ':' . $placeholder;
|
$placeholder = $hours . ':' . $placeholder;
|
||||||
|
|
||||||
$placeholder = ereg_replace( '^0', '', $placeholder );
|
$placeholder = preg_replace( '/^0/', '', $placeholder );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $readonly ) {
|
if ( $readonly ) {
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ class SP_Event extends SP_Custom_Post{
|
|||||||
if ( '00' != $hours )
|
if ( '00' != $hours )
|
||||||
$timeval = $hours . ':' . $timeval;
|
$timeval = $hours . ':' . $timeval;
|
||||||
|
|
||||||
$timeval = ereg_replace( '^0', '', $timeval );
|
$timeval = preg_replace( '/^0/', '', $timeval );
|
||||||
|
|
||||||
$performance[ $team ][ $player ][ $performance_key ] = $timeval;
|
$performance[ $team ][ $player ][ $performance_key ] = $timeval;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
@@ -603,7 +603,7 @@ class SP_Player_List extends SP_Custom_Post {
|
|||||||
if ( '00' != $hours )
|
if ( '00' != $hours )
|
||||||
$timeval = $hours . ':' . $timeval;
|
$timeval = $hours . ':' . $timeval;
|
||||||
|
|
||||||
$timeval = ereg_replace( '^0', '', $timeval );
|
$timeval = preg_replace( '/^0/', '', $timeval );
|
||||||
|
|
||||||
$placeholders[ $player ][ $key ] = $timeval;
|
$placeholders[ $player ][ $key ] = $timeval;
|
||||||
endforeach;
|
endforeach;
|
||||||
@@ -642,7 +642,7 @@ class SP_Player_List extends SP_Custom_Post {
|
|||||||
if ( '00' != $hours )
|
if ( '00' != $hours )
|
||||||
$timeval = $hours . ':' . $timeval;
|
$timeval = $hours . ':' . $timeval;
|
||||||
|
|
||||||
$timeval = ereg_replace( '^0', '', $timeval );
|
$timeval = preg_replace( '/^0/', '', $timeval );
|
||||||
|
|
||||||
$merged[ $player ][ $key ] = $timeval;
|
$merged[ $player ][ $key ] = $timeval;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
@@ -612,7 +612,7 @@ class SP_Player extends SP_Custom_Post {
|
|||||||
if ( '00' != $hours )
|
if ( '00' != $hours )
|
||||||
$timeval = $hours . ':' . $timeval;
|
$timeval = $hours . ':' . $timeval;
|
||||||
|
|
||||||
$timeval = ereg_replace( '^0', '', $timeval );
|
$timeval = preg_replace( '/^0/', '', $timeval );
|
||||||
|
|
||||||
$placeholders[ $season ][ $key ] = $timeval;
|
$placeholders[ $season ][ $key ] = $timeval;
|
||||||
endforeach;
|
endforeach;
|
||||||
@@ -692,7 +692,7 @@ class SP_Player extends SP_Custom_Post {
|
|||||||
if ( '00' != $hours )
|
if ( '00' != $hours )
|
||||||
$timeval = $hours . ':' . $timeval;
|
$timeval = $hours . ':' . $timeval;
|
||||||
|
|
||||||
$timeval = ereg_replace( '^0', '', $timeval );
|
$timeval = preg_replace( '/^0/', '', $timeval );
|
||||||
|
|
||||||
$merged[ $season ][ $performance_key ] = $timeval;
|
$merged[ $season ][ $performance_key ] = $timeval;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
Reference in New Issue
Block a user