1. Home
  2. Docs
  3. Overview
  4. Form Fields
  5. Action Hook

Action Hook

Action Hook Integration

The Action Hook field enables you to add custom functionality to your forms using WordPress actions.

Setup

  1. Add Action Hook field to your form:
  • Drag the “Action Hook” field from the form builder
  • Set a unique action hook name (e.g., ‘my_custom_form_action’)
  • Add description for documentation

Example Usage

// Hook into your custom action
add_action('my_custom_form_action', 'my_custom_function', 10, 4);

function my_custom_function($post_id, $attributes, $field, $form_settings) {
    // $post_id: Current post ID
    // $attributes: Form attributes array
    // $field: Current field settings
    // $form_settings: Complete form settings array

    // Example: Add custom meta to post
    echo 'your custom code here';
}

Available Parameters

  • $post_id (int): Current post ID
  • $attributes (array): Form attributes and settings
  • $field (array): Current field configuration
  • $form_settings (array): Complete form settings

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *