Gravity Forms

How it works

Weight Tracker, can examine Gravity Form submissions for relevant Weight and Measurement data. If valid data is found, a weight entry will automatically be created for the user currently logged in. This allows you to mix Weight Tracker fields amongst your Gravity Forms to provide a more tailored experience.

So, how does it work? If enabled, it examines every Gravity Form submission for fields that have certain CSS classes. If a field has one of the Weight Tracker classes, it is further examined and validated. If the data looks good as a whole, then a weight and measurement entry is added for the given date.


By default, Weight Tracker will not process Gravity Forms. To enable this functionality, from your WP Dashboard navigate to Weight Tracker > Settings. From the tab “3rd Party” ensure “Enable Gravity Forms” is set to Yes. Then Save.

CSS Classes

The table below illustrates the classes that can be added to Gravity Form fields. For the form to be processed, you must have a date and weight. Other fields are optional.

For example, say you wish to have a form with fields for Pounds, Date and Notes. Create a Gravity form with a numeric field and under the Appearance tab, add the CSS Class “wlt-pounds”. Next, add a date picker field and assign the CSS class “wlt-date”. Finally, add a text area for notes and add the CSS class wlt-notes.

When the form is submitted, if a numeric value has been entered for pounds (or other relevant weight fields) and a valid date specified then a Weight Entry will be added.

If other fields have a Weight Tracker CSS name and contain valid data, then their data will be attached to the new weight entry.


CSS class name Mandatory Related Weight Tracker field
Mandatory Fields
wlt-date Yes Date
wlt-kg Yes (or other weight field) For Kg entry (other weight fields are not needed)
wlt-stones Yes (or other weight field) For Stones and Pounds (must be used alongside wlt-pounds)
wlt-pounds Yes (or other weight field) For Stones (wlt-stones must be used on same form) and Pounds or it can be used alone.
Optional Fields
wlt-notes No Notes field
wlt-left-forearm No Left Forearm
wlt-right-forearm No Right Forearm
wlt-left-bicep No Left Bicep
wlt-right-bicep No Right Bicep
wlt-left-calf No Left Calf
wlt-right-calf No Right Calf
wlt-left-thigh No Left Thigh
wlt-right-thigh No Right Thigh
wlt-waist No Waist
wlt-shoulders No Shoulders
wlt-buttocks No Buttocks
wlt-hips No Hips
wlt-height No Height
wlt-navel No Navel
wlt-neck No Neck
wlt-bust-chest No Bust / Chest
wlt-photo No This should be applied to a Gravity Form file upload field. IF a photo is uploaded, it will assign it to the weight entry.
wlt-meta-[meta key] No You can use this class name format to link Gravity Form fields to your Custom Fields. If you have a field key of "cups-of-water" for a given field, then the CSS class name you would specify on the GF field would be "wlt-meta-cups-of-water"


If you are finding that weight entries aren’t being created, please turn on Gravity Forms debugging ( Forms > Settings > Logging ) and re-submit the form. Once submitted, refresh the settings page and click View Log. From here, you should see messages from the Weight Tracker plugin. Hopefully one of these messages will help you to understand why the weight entry was rejected.

Gravity Forms example

The following JSON file is an example form that you can import into Gravity Forms. Simply save the file to your computer as example.json and use the Gravity Forms import tool to import it into it WordPress.

Get JSON example