Actions
WordPress Actions are a way to hook into WordPress and run your own code. They are similar to WordPress Filters, but they do not return a value. Instead, they allow you to run your own code at a specific time in the WordPress execution process.
Bricksforge provides a number of actions that you can hook into.
Form Actions
bricksforge/pro_forms/before_submit
Fires before the form is submitted. Only fires for Pro Forms.
add_action( 'bricksforge/pro_forms/before_submit', function( $form_data ) {
// Do something.
});
bricksforge/pro_forms/after_submit
Fires after the form is submitted. Only fires for Pro Forms.
add_action( 'bricksforge/pro_forms/after_submit', function( $form_data, $results ) {
// Do something.
});
bricksforge/pro_forms/post_created
Fires after the post is created using Pro Forms
add_action( 'bricksforge/pro_forms/post_created', function( $post_id ) {
// Do something with the post ID of the created post.
});
bricksforge/pro_forms/post_updated
Fires after the post is updated using Pro Forms
add_action( 'bricksforge/pro_forms/post_updated', function( $post_id ) {
// Do something with the post ID of the updated post.
});
bricksforge/pro_forms/post_meta_updated
Fires after the post meta is updated using Pro Forms
add_action( 'bricksforge/pro_forms/post_meta_updated', function( $post_id, $post_meta_name, $new_post_meta_value ) {
// Do something with the post ID of the updated post.
});
bricksforge/pro_forms/user_meta_updated
Fires after the user meta is updated using Pro Forms
add_action( 'bricksforge/pro_forms/user_meta_updated', function( $user_id, $key, $new_value) {
// Do something with the user ID of the updated user.
});
bricksforge/pro_forms/webhook_sent
Fires after the webhook is sent using Pro Forms
add_action( 'bricksforge/pro_forms/webhook_sent', function( $result ) {
// Do something with the result of the webhook.
});
bricksforge/pro_forms/submission_created
Fires after the submission is created using Pro Forms
add_action( 'bricksforge/pro_forms/submission_created', function( $submission_data ) {
// Do something with the submission data.
});