Skip to content

Commit

Permalink
Merge pull request #573 from alicolville/percentage-values
Browse files Browse the repository at this point in the history
10.7.2
  • Loading branch information
alicolville authored Nov 6, 2023
2 parents e8d8285 + f612046 commit aa475e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1277,13 +1277,15 @@ function ws_ls_blur_text( $text, $pro_plus = false ) {

/**
* Return a given percentage of a number
*
* @param $total
* @param int $percentage
*
* @return int|string
*/
function ws_ls_calculate_percentage_of_number( $total, $percentage = 100 ) {

$percentage = (int) $percentage;
$percentage = (float) $percentage;

if ( 100 === $percentage ) {
return $total;
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: aliakro
Tags: weight,tracker,chart,bmi,bmr,macronutrient,measure,awards,custom fields,history,measurements,data
Requires at least: 5.7
Tested up to: 6.3
Stable tag: 10.7.1
Stable tag: 10.7.2
Requires PHP: 7.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -152,7 +152,11 @@ Measurements are created using Custom Fields. You can therefore specify the unit

== Changelog ==

= 10.7 =
= 10.7.2 =

* Improvement: The "percentage" argument of [wlt-calories progress="auto" percentage=4.4] now supports decimal places.

= 10.7.1 =

* Improvement: Added support under the hood for mixed forms (e.g. that contain weights and targets) - note: this functionality is currently exposed to the end user.

Expand Down
2 changes: 1 addition & 1 deletion weight-loss-tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Plugin Name: Weight Tracker
* Description: Allow your users to track their weight, body measurements, photos and other pieces of custom data. Display in charts, tables, shortcodes and widgets. Manage their data, issue awards, email notifications, etc! Provide advanced data on Body Mass Index (BMI), Basal Metabolic Rate (BMR), Calorie intake, Harris Benedict Formula, Macronutrients Calculator and more.
* Version: 10.7.1
* Version: 10.7.2
* Requires at least: 5.7
* Tested up to: 6.3
* Requires PHP: 7.2
Expand Down

0 comments on commit aa475e6

Please sign in to comment.