Skip to content
All guides

For developers

FillKite has filters and actions for the parts that matter. Some examples:

Hooks
Hook Type Use it to
fillkite_before_save_entry Filter Change an entry, or return a WP_Error to stop it. Receives $entry, $form.
fillkite_after_save_entry Action Run code after an entry is saved. Receives $entry, $form.
fillkite_entry_status_changed Action React when an entry moves to Replied, Won and so on.
fillkite_register_fields Action Register your own field types.
fillkite_notification_email Filter Change an email before it is sent.
fillkite_merge_tags Filter Add or change merge tags.
fillkite_webhook_payload Filter Change what a webhook sends.
fillkite_spam_check Filter Add your own spam check. Return a reason to mark the entry as spam.
fillkite_rate_limit Filter Change the rate limit for a form.
fillkite_disposable_domains Filter Add or remove blocked email domains.
fillkite_client_ip Filter Read the visitor’s IP from a proxy header.
fillkite_submission_redirect Filter Send the visitor somewhere else after submitting.
fillkite_render_field Filter Change a field just before it is shown, such as disabling a full choice.
fillkite_form_gate Filter Show something else in place of a form.
fillkite_confirmation_message Filter Change the thank-you message.
fillkite_lead_quality Filter Change an entry’s lead quality.
fillkite_spam_phrases Filter Add phrases the spam score looks for.
fillkite_app_tabs Filter Add your own screen to the FillKite header. Each tab is label, url and cap, with an optional badge count.
fillkite_app_plan Filter Change the plan chip in the header. Return label and pro (true or false).
window.fillkite.holds( form, conditions ) JavaScript Check whether a set of rules holds for the current answers, so an add-on can build rules on the same engine as field logic.
LogicEditor Prop Add-on settings cards in the builder receive a LogicEditor prop, the same rule editor FillKite uses for field logic.
fillkite_theme_button_themes Filter Choose which classic themes the Send button follows when Send button look is Automatic. Receives the list of theme slugs.

Example: build your own rules on the same engine

FillKite Pro’s Submit rules are made with two free pieces, and your add-on can use them too. window.fillkite.holds() checks rules in the visitor’s browser, and the LogicEditor prop gives your settings card the same rule editor as field logic.

1. Check rules on the page

Rules are written like field logic: match is all or any, and each rule has a field, an operator and a value. Fields hidden by logic count as unanswered. This example stops the form while an order is not paid:

const form = document.querySelector( '.fk-form[data-fk-form="12"]' );
const rules = {
	match: 'all',
	rules: [ { field: 'f_paid', operator: 'is', value: 'No' } ],
};

form.addEventListener( 'fillkite:beforesubmit', ( event ) => {
	// true when the rules hold for the answers on the screen right now
	if ( window.fillkite.holds( form, rules ) ) {
		event.preventDefault();
		// show your own message here
	}
} );

A set of rules with no rules in it holds for everyone, so check that it has rules before you use it to block anything. Browser checks can be skipped, so check again on the server with the fillkite_before_save_entry filter and return a WP_Error. You can see this in action on the paid order support demo.

2. Add a rules card to the builder

Add a card to the form’s Settings tab with the fillkite.builder.formSettings filter. Your component gets value, onChange, the form’s fields and the LogicEditor:

wp.hooks.addFilter( 'fillkite.builder.formSettings', 'my-addon', ( cards ) => [
	...cards,
	{
		key: 'myRules',
		title: 'My rules',
		description: 'Stop the form when these rules hold.',
		Component: ( { value, onChange, fields, LogicEditor } ) =>
			wp.element.createElement( LogicEditor, {
				field: { id: 'myRules', logic: value },
				fields,
				onChange: ( patch ) => onChange( patch.logic ),
				copy: { title: 'When', toggle: 'Use rules', subject: 'Stop the form if' },
			} ),
	},
] );

On the PHP side, keep your key with the fillkite_form_settings filter so it is saved with the form.

WP-CLI: wp fillkite forms, wp fillkite entries and wp fillkite export.

Every hook has a short description in the plugin’s code.

Credits: the FillKite admin screens use Plus Jakarta Sans and IBM Plex Mono, bundled with the plugin under the SIL Open Font License 1.1.

Last updated:

212 live demosTry forms, no sign-up