Skip to content

Commit

Permalink
Merge pull request #540 from alicolville/10.3.3
Browse files Browse the repository at this point in the history
10.3.3
  • Loading branch information
alicolville committed Dec 29, 2022
2 parents b5d6e75 + 3232279 commit 4a7d700
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 11 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added docs/assets/images/component-user-id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Below are the currently available summary boxes that you can use:

[![](/assets/images/component-age-dob.png)](/assets/images/component-age-dob.png)

#### bmi

[![](/assets/images/component-bmi.png)](/assets/images/component-bmi.png)

#### calories-gain

[![](/assets/images/component-calories-gain.png)](/assets/images/component-calories-gain.png)
Expand Down Expand Up @@ -122,11 +126,11 @@ Displays a count of all entries that has a weight entered).
#### number-of-days-tracking

[![](/assets/images/component-number-of-days-tracking.png)](/assets/images/component-number-of-days-tracking.png)

#### user-id

#### bmi

[![](/assets/images/component-bmi.png)](/assets/images/component-bmi.png)

[![](/assets/images/component-user-id.png)](/assets/images/component-user-id.png)

#### weight-difference-since-previous

[![](/assets/images/component-weight-difference-since-previous.png)](/assets/images/component-weight-difference-since-previous.png)
Expand Down
26 changes: 25 additions & 1 deletion includes/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function ws_ls_uikit_summary_boxes( $arguments, $boxes = [] ) {
$allowed_boxes = [ 'number-of-entries', 'number-of-weight-entries', 'latest-weight', 'start-weight', 'number-of-days-tracking',
'target-weight', 'previous-weight', 'latest-versus-target', 'bmi', 'bmr', 'latest-award', 'number-of-awards',
'name-and-email', 'start-bmr', 'start-bmi', 'age-dob', 'activity-level', 'height', 'aim', 'gender', 'group',
'latest-versus-start', 'divider', 'weight-difference-since-previous', 'calories-maintain', 'calories-lose', 'calories-gain', 'calories-auto' ];
'latest-versus-start', 'divider', 'weight-difference-since-previous', 'calories-maintain', 'calories-lose', 'calories-gain', 'calories-auto', 'user-id' ];

// Default box selection
if ( true === empty( $boxes ) ) {
Expand Down Expand Up @@ -144,6 +144,9 @@ function ws_ls_uikit_summary_boxes( $arguments, $boxes = [] ) {
case 'name-and-email':
$html .= ws_ls_component_name_and_email( $arguments );
break;
case 'user-id':
$html .= ws_ls_component_user_id( $arguments );
break;
case 'age-dob':
$html .= ws_ls_component_age_dob( [ 'user-id' => $arguments[ 'user-id' ] ] );
break;
Expand Down Expand Up @@ -870,6 +873,27 @@ function ws_ls_component_name_and_email( $args = [] ) {
);
}

/**
* User ID component
* @param array $args
*
* @return string
*/
function ws_ls_component_user_id( $args = [] ) {

$args = wp_parse_args( $args, [ 'user-id' => get_current_user_id() ] );

return sprintf( '<div>
<div class="ykuk-card ykuk-card-small ykuk-card-body ykuk-box-shadow-small ykuk-overflow-auto">
<span class="ykuk-info-box-header">%1$s</span><br />
<span class="ykuk-text-bold">%2$d</span>
</div>
</div>',
__( 'User ID', WE_LS_SLUG ),
$args[ 'user-id' ]
);
}

/**
* Render link with modal
*
Expand Down
2 changes: 1 addition & 1 deletion pro-features/user-preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function ws_ls_user_preferences_form( $user_defined_arguments ) {

// If enabled, show Delete data
if( ( true === isset( $arguments[ 'allow-delete-data' ] ) && true === $arguments[ 'allow-delete-data' ] ) ||
false === empty( $arguments[ 'show-delete-data' ] ) ) {
true === ws_ls_to_bool( $arguments[ 'show-delete-data' ] ) ) {

if ( false === ws_ls_to_bool( $arguments[ 'hide-titles' ] ) ) {
$html_output .= ws_ls_title( __( 'Delete existing data', WE_LS_SLUG ) );
Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
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.0.2
Stable tag: 10.3.2
Tested up to: 6.1.1
Stable tag: 10.3.3
Requires PHP: 7.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -152,6 +152,11 @@ Measurements are created using Custom Fields. You can therefore specify the unit

== Changelog ==

= 10.3.3 =

* Improvement: Added a new summary box component "user-id". Read more https://docs.yeken.uk/components.html
* Bug fix: [wt-user-settings] now correctly respects the "show-delete-data" argument correctly.

= 10.3.2 =

* Improvement: Added Beta support for Barcode scanning in [wt-kiosk]. Read more: https://docs.yeken.uk/shortcodes/wt-kiosk.html
Expand Down
6 changes: 3 additions & 3 deletions weight-loss-tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
/**
* 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.3.2
* Version: 10.3.3
* Requires at least: 5.7
* Tested up to: 6.0.2
* Tested up to: 6.1.1
* Requires PHP: 7.2
* Author: Ali Colville
* Author URI: https://www.YeKen.uk
Expand All @@ -18,7 +18,7 @@
*/

define( 'WS_LS_ABSPATH', plugin_dir_path( __FILE__ ) );
define( 'WE_LS_CURRENT_VERSION', '10.3.2' );
define( 'WE_LS_CURRENT_VERSION', '10.3.3' );
define( 'WE_LS_TITLE', 'Weight Tracker' );
define( 'WE_LS_SLUG', 'weight-loss-tracker' );
define( 'WE_LS_LICENSE_TYPES_URL', 'https://docs.yeken.uk/features.html' );
Expand Down

0 comments on commit 4a7d700

Please sign in to comment.