Skip to content

Instantly share code, notes, and snippets.

@Crocoblock
Last active November 6, 2025 15:49
Show Gist options
  • Save Crocoblock/7778d2082588d6af4ebdef4bc713175f to your computer and use it in GitHub Desktop.
Save Crocoblock/7778d2082588d6af4ebdef4bc713175f to your computer and use it in GitHub Desktop.
JetFormBuilder. Update user meta on the Call a Hook action. Required for the case, when we need refresh user meta on Subscription cycle.
<?php
/**
* Key points:
* - refresh_user_date - hook name for the JetFormBuild Call a Hook action
* - user_date - meta field we need to update
* - DAY_IN_SECONDS - subscription cycle
*/
add_action( 'jet-form-builder/custom-action/refresh_user_date', function( $request ) {
if ( ! empty( $request['user_id'] ) ) {
$new_exp = time() + DAY_IN_SECONDS;
update_user_meta( $request['user_id'], 'user_date', $current_exp );
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment