[wlt-message]
The message shortcode can be used to display custom content when a user gains or loses weight over a number of consecutive weight entries. This will allow you to motivate people when they gain weight a number of times or congratulate if they lose weight.
Below are some examples of its use:
[weight-loss-tracker-message type=lost]
Well done you have lost weight (since last weight)
[/weight-loss-tracker-message]
[weight-loss-tracker-message type=lostĀ consecutive=3]
Well done you have lost weight 3 times
[/weight-loss-tracker-message]
[weight-loss-tracker-message type=gain]
Unlucky, you have gained weight since your last entry.
[/weight-loss-tracker-message]
[weight-loss-tracker-message type=gain consecutive=3]
Oh no… you have gained weight 3 times…
[/weight-loss-tracker-message]
The shortcode supports the following arguments:
Argument | Description | Options | Example |
---|---|---|---|
type | The type determines whether to check for weight gain or weight loss. | 'gained' (default)- Gained weight since previous chronlogical entry. 'lost' - Lost weight since previous chronlogical entry | [wlt-message type='lost']Message here[/wlt-message] |
consecutive | The number of previous consecutive weight entries to consider. For example, if set to 3, then the previous 3 weight entries must have consistently gained or lost weight. | Number between 1 and 30. Default 1. | [wlt-message consecutive=3]Message here[/wlt-message] |