Merge pull request #14523 from franticpsyx/fix-wc-get-weight-notice-warning
[3.0.3] Fix PHP 7.1 `wc_get_weight` warning
This commit is contained in:
commit
b13380d120
|
@ -165,6 +165,7 @@ function wc_get_dimension( $dimension, $to_unit, $from_unit = '' ) {
|
||||||
* @return float
|
* @return float
|
||||||
*/
|
*/
|
||||||
function wc_get_weight( $weight, $to_unit, $from_unit = '' ) {
|
function wc_get_weight( $weight, $to_unit, $from_unit = '' ) {
|
||||||
|
$weight = (float) $weight;
|
||||||
$to_unit = strtolower( $to_unit );
|
$to_unit = strtolower( $to_unit );
|
||||||
|
|
||||||
if ( empty( $from_unit ) ) {
|
if ( empty( $from_unit ) ) {
|
||||||
|
|
Loading…
Reference in New Issue