Hooks and Filters

Hooks

The plugin has the following hooks:

Hook name Description Arguments
wlt-hook-data-user-deleted Fired when a user deletes all of their data. User ID (their WP user ID)
wlt-hook-data-all-deleted Fired when an administrator deletes all user data. None
wlt-hook-data-added-edited When a user adds or updates their target. OR adds or updates a weight / measurement entry for a given day. 1) Type. An array containing summary information about the event. User ID, add / update and whether it was a target or weight entry.

2) Weight object representing all the relevant values regarding the weight added.
wlt-hook-data-entry-deleted When a weight entry is deleted this hook is fired. 1) An associative array of data that represents the entry.
wlt-hook-license-expired Thrown when a license expires. Usually used within the plugin to send notification emails etc.

Filters

The plugin supports the following filters:

Hook name Description Arguments
wlt-filter-email-data Filter the email body being sent when notifying administrators about a weight entry. $email_data , $type, $weight_data
wlt-filter-form-saved-message Filter the message displayed after a form is saved. $message
wlt-filter-stats-table-row Manipulate the row data within the User Stats table. $row
wlt-filter-stats-table-html Modify the HTML output of the Stats table. $html
wlt-filter-stats-shortcode Modify the value of each stat used in the Stats table. $stats