Skip to content

Commit

Permalink
Removed Decimal setting
Browse files Browse the repository at this point in the history
  • Loading branch information
alicolville committed Mar 21, 2017
1 parent 8e98d01 commit 1569eb0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 27 deletions.
5 changes: 0 additions & 5 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ function ws_ls_weight_object($user_id, $kg, $pounds, $stones, $pounds_only, $not
}
}

// If not allowing decimals, then round figures down
if(!WS_LS_USE_DECIMALS){
$weight = ws_ls_round_weights($weight);
}

// Generate display
switch (ws_ls_get_config('WE_LS_DATA_UNITS')) {
case 'pounds_only':
Expand Down
7 changes: 0 additions & 7 deletions includes/globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
'WE_LS_WEIGHT_LINE_COLOUR' => '#aeaeae',
'WE_LS_WEIGHT_FILL_COLOUR' => '#f9f9f9',
'WE_LS_US_DATE' => false,
'WS_LS_USE_DECIMALS' => false,
'WE_LS_CHART_TYPE' => 'line', //line, bar
'WS_LS_ADVANCED_TABLES' => true,
'WE_LS_CHART_MAX_POINTS' => 25,
Expand Down Expand Up @@ -142,12 +141,6 @@
$globals['WE_LS_US_DATE'] = true;
}
// -----------------------------------------------------------------------------------
// Allow decimals?
// -----------------------------------------------------------------------------------
if ('yes' == get_option('ws-ls-allow-decimals')){
$globals['WS_LS_USE_DECIMALS'] = true;
}
// -----------------------------------------------------------------------------------
// Plot points
// -----------------------------------------------------------------------------------
if (WS_LS_IS_PRO && get_option('ws-ls-max-points')){
Expand Down
12 changes: 0 additions & 12 deletions pages/page.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,6 @@ function ws_ls_settings_page() {
<p><?php echo __('If enabled, a user is allowed to enter a target weight. This will be displayed as a horizontal bar on the line chart.', WE_LS_SLUG); ?></p>
</td>
</tr>
<tr class="<?php echo $disable_if_not_pro_class; ?>">
<th scope="row"><?php echo __( 'Allow decimal places?' , WE_LS_SLUG); ?></th>
<td>
<select id="ws-ls-allow-decimals" name="ws-ls-allow-decimals">
<option value="yes" <?php selected( get_option('ws-ls-allow-decimals'), 'yes' ); ?>><?php echo __('Yes', WE_LS_SLUG)?></option>
<option value="no" <?php selected( get_option('ws-ls-allow-decimals'), 'no' ); ?>><?php echo __('No', WE_LS_SLUG)?></option>

</select>
<p><?php echo __('If enabled, Decimal weight entries will be allowed in Kg or Pounds mode.', WE_LS_SLUG)?></p>
</td>
</tr>
<tr class="<?php echo $disable_if_not_pro_class; ?>">
<th scope="row"><?php echo __( 'Display BMI in tables?' , WE_LS_SLUG); ?></th>
<td>
Expand Down Expand Up @@ -510,7 +499,6 @@ function ws_ls_register_settings()
// Pro only open
if(WS_LS_IS_PRO){
register_setting( 'we-ls-options-group', 'ws-ls-allow-user-preferences' );
register_setting( 'we-ls-options-group', 'ws-ls-allow-decimals' );
register_setting( 'we-ls-options-group', 'ws-ls-chart-type' );
register_setting( 'we-ls-options-group', 'ws-ls-allow-advanced-tables' );
register_setting( 'we-ls-options-group', 'ws-ls-max-points' );
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: aliakro
Tags: weight, loss, lose, helper, bmi, body, mass, index, graph, track, stones, kg, table, data, plot, target, history, pounds, responsive, chart, measurements, cm, centimeters, inches, hip, waist, bicep, thigh
Requires at least: 4.1.0
Tested up to: 4.7.2
Stable tag: 4.2.4
Stable tag: 4.2.5

License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -158,6 +158,10 @@ Lots of new features. Three new Pro shortcodes, email notifications and more.

== Changelog ==

= 4.2.5 =

* Decimal places are now a core feature and no longer just a perk of Pro.

= 4.2.4 =

* Added simpler shortcodes (don't worry the old ones still work):
Expand Down
4 changes: 2 additions & 2 deletions weight-loss-tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Plugin Name: Weight Loss Tracker
* Description: Allow registered users of your website to track their weight and relevant body measurements. History can be displayed in both tables & charts.
* Version: 4.2.4
* Version: 4.2.5
* Author: YeKen
* Author URI: https://www.YeKen.uk
Expand All @@ -29,7 +29,7 @@
*/

define('WS_LS_ABSPATH', plugin_dir_path( __FILE__ ));
define('WE_LS_CURRENT_VERSION', '4.2.4');
define('WE_LS_CURRENT_VERSION', '4.2.5');

// -----------------------------------------------------------------------------------------
// AC: Activate / Deactivate / Uninstall Hooks
Expand Down

0 comments on commit 1569eb0

Please sign in to comment.