Skip to content

Commit

Permalink
Merge pull request #14523 from franticpsyx/fix-wc-get-weight-notice-w…
Browse files Browse the repository at this point in the history
…arning

[3.0.3] Fix PHP 7.1 `wc_get_weight` warning
  • Loading branch information
claudiulodro committed Apr 19, 2017
2 parents 1c0b4ed + 6392582 commit b13380d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions includes/wc-formatting-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ function wc_get_dimension( $dimension, $to_unit, $from_unit = '' ) {
* @return float
*/
function wc_get_weight( $weight, $to_unit, $from_unit = '' ) {
$weight = (float) $weight;
$to_unit = strtolower( $to_unit );

if ( empty( $from_unit ) ) {
Expand Down

0 comments on commit b13380d

Please sign in to comment.