Archives

Tutorials

Creating Merge tags

This guide is based on the assumption that you’re setting your plugin up using our Kozo plugin template creator. The first step in setting up new merge tags is registering the merge tag in the constructor of the main plugin …

Continue reading

Filter Email “From” Address

Action settings can be filtered time of form submission using the ninja_forms_run_action_settings filter. An example of using this filter is setting a global override of the “From Address” for all forms.

Continue reading

Adding Attachments to Emails

Additional attachments can be added to a Ninja Forms email using the ninja_forms_action_email_attachments filter. This filter passes an array of attachments, a copy of the raw form data, and the settings for the form. <?php add_filter( 'ninja_forms_action_email_attachments', function( $attachments, $data, …

Continue reading

Dynamic List Fields

A field’s settings can be set dynamically when the form is rendered on the page – this is when the field data is “localized” to the page for use by the form. Dynamic Field Settings The list field types uses …

Continue reading

Custom Server-Side Validation

The Ninja Forms submission processes as an AJAX request, which expects a JSON object response from the server. Custom validation errors can be set by manually terminating the request cycle, providing the errors as a JSON response. Example <?php add_filter( …

Continue reading

Dynamic reCAPTCHA Language

The language of the reCAPTCHA is stored as a Ninja Forms setting, which can be dynamically set on page load to accommodate multi-lingual sites or language specific forms. <?php /** * Update the recaptcha_lang setting. * * @param string $setting_key …

Continue reading

Loading the Form via AJAX

Ninja Forms is a JavaScript rendered application, which requires that the necessary script files be loaded onto the page for the form to render. Because of the way that WordPress (normally) renders content and enqueues scripts, this can create a …

Continue reading