introduced the wc_strtolower() function, closes #6575

This commit is contained in:
claudiosmweb 2014-10-21 10:51:16 -02:00
parent 40bd9bc974
commit 42820ea88d
2 changed files with 13 additions and 1 deletions

View File

@ -589,3 +589,15 @@ function wc_format_phone_number( $tel ) {
$tel = str_replace( '.', '-', $tel );
return $tel;
}
/**
* Make a string lowercase.
* Try to use mb_strtolower() when available.
*
* @since 2.3
* @param string $string
* @return string
*/
function wc_strtolower( $string ) {
return function_exists( 'mb_strtolower' ) ? mb_strtolower( $string ) : strtolower( $string );
}

View File

@ -56,7 +56,7 @@ function wc_get_order_status_name( $status ) {
$status = 'wc-' === substr( $status, 0, 3 ) ? substr( $status, 3 ) : $status;
$status = isset( $statuses[ 'wc-' . $status ] ) ? $statuses[ 'wc-' . $status ] : $status;
return function_exists( 'mb_strtolower' ) ? mb_strtolower( $status ) : strtolower( $status );
return wc_strtolower( $status );
}
/**