Skip to main content
Documentation/Developers/APIs/Hooks Reference/Forms
Developers

Forms

These need Breakdance Forms for Oxygen.

Rendering and email

oxygen_render_form_html

Filter, $output, $props, $fields. The rendered form markup, with the form element's
settings and its field definitions alongside it.

add_filter('oxygen_render_form_html', function ($output, $props, $fields) {
    return $output . '<p class="form-note">We reply within one business day.</p>';
}, 10, 3);

oxygen_email_message, oxygen_email_headers, oxygen_email_attachments

Filters. The email a form action sends. Each receives only its own value: the message body
as a string (already run through nl2br() when the action sends HTML), the headers as an
array of Name: value strings, and the attachments as an array of file paths.

add_filter('oxygen_email_message', function ($message) {
    return $message . "nn-- nSent from example.com";
});

Submissions

oxygen_form_submission_capability

Filter, 'manage_options'. Who may read submissions.

add_filter('oxygen_form_submission_capability', fn() => 'edit_pages');

oxygen_form_honeypot_triggered

Action, $settings, $fields, $ip. A submission was rejected as spam. The visitor still
sees the success message, so this hook is the only trace it happened — worth logging if you
want to know how much you're catching.

add_action('oxygen_form_honeypot_triggered', function ($settings, $fields, $ip) {
    error_log(sprintf('[oxygen] honeypot rejected a submission from %s', $ip));
}, 10, 3);