Flavonto Forms documentation, version 1.0.0

Developers

PHP functions and constants

Functions for themes and plugins, wp-config.php constants and capabilities.

Functions

flavonto_form( $id, $args = array() )

Prints a form. Arguments:

Key Type Meaning
values array or string Prefilled answers, as array( 'field_name' => 'value' ) or 'field_name=value&other=value'. Only fields that allow dynamic values accept them
show_title bool or null Show or hide the title; null follows the form
show_description bool or null The same for the introduction
popup bool Print a button and a dialog instead of the inline form
label string Button text for popups
width int Popup width in pixels
trigger string button (default) or none for a popup opened by links to #flavonto-form-{id}
<?php
if ( function_exists( 'flavonto_form' ) ) {
	flavonto_form( 3, array( 'values' => array( 'topic' => 'sales' ), 'show_title' => false ) );
}

flavonto_get_form( $id, $args = array() )

Returns the same HTML instead of printing it.

flavonto_signed_url( $url, $form_id, $field_name, $value )

Returns $url with a value for a hidden field whose source is Signed link value, plus its signature. Visitors cannot change the value: the server checks the signature when the form is sent. Use it for keys such as a row id that a database action updates.

$link = flavonto_signed_url( home_url( '/edit-listing/' ), 7, 'listing_id', (string) $listing->id );

Constants for wp-config.php

Constant Meaning
FLVF_ENCRYPTION_KEY Encryption key: any value of at least 32 characters (turned into a key with SHA-256), or base64 of 32 bytes (used as it is). Keeps encrypted answers unreadable from a database copy alone
FLVF_ENCRYPTION_KEY_OLD The previous key while re-encrypting after a change
FLVF_PRIVATE_DIR Absolute path of the folder for private files, ideally outside the web root
FLVF_LICENCE_API Another licence server address (staging)

Capabilities

Capability Allows
flvf_manage_forms Create, edit, publish, duplicate, export and delete forms
flvf_view_entries View entries and download their files
flvf_edit_entries Edit entries, change labels and statuses, add notes, resend notifications
flvf_delete_entries Trash and permanently delete entries
flvf_export_entries Export entries
flvf_import Import forms, entries and Quform data
flvf_manage_settings Change global settings and privacy, see diagnostics and jobs
flvf_manage_integrations Manage credentials, integrations, webhooks and payments

Administrators of single sites have all of them (filter flvf_admins_have_all_caps). Grant them to other roles in Settings, Permissions, or with WP_Role::add_cap(). A form can further limit who sees its entries by role.

Shortcodes

[flavonto_form], [flavonto_form_popup] and [flavonto_form_count] are described in the customer guide, Embedding forms.