Skip to content

ITC Forms 0.15.6Changelog

Extension API 1.0

See extension recipes for declarative field settings, custom renderers, managed automation handlers and three standalone add-ons.

ItouchCode\Forms\ExtensionRegistry::API_VERSION and the browser export EXTENSION_API_VERSION are both 1.0.0. PHP owns normalization, permissions, nonces, persistence, feed selection, and delivery. The localized browser manifest contains only safe labels, keys, and control metadata—never callbacks, capabilities, destinations, saved values, or secrets.

  • Stable: hooks and descriptor fields in this document retain their names, argument order, and security meaning for the current major API version.
  • Experimental: a hook explicitly marked experimental may change after a changelog notice. Do not use it for required production behavior.
  • Internal: undocumented classes, REST internals, DOM classes, cron hooks, and localized globals are not extension points.

A stable hook is deprecated for at least one minor plugin release before a major API can remove it. The changelog names its replacement and removal window. itc_forms_managed_feed_execute is the compatibility bridge for old custom providers; new provider descriptors use enqueue. The bridge remains available throughout Extension API 1.x and may be removed no earlier than Extension API 2.0.

Registry filters receive core defaults and must return the complete registry. Invalid descriptors are ignored and core keys cannot be replaced. Extensions are trusted code, but core still checks its own capability and nonce before invoking action callbacks.

Extension API 1.0’s existing field-type, condition-operator, feed-provider, builder-panel, form-action, entry-action, settings, Tools, and spam-provider registries retain their canonical legacy slug format (acme_crm, lowercase letters, numbers, underscores, or hyphens). This is a compatibility contract: changing those persisted or referenced keys to slash namespaces would break existing forms and add-ons. Prefix legacy slugs with a unique vendor identifier and never reuse a core key. Registries introduced after API 1.0 require a true vendor/feature namespace unless their contract explicitly documents a legacy bridge. Slash namespaces are already required for extension-data envelopes and field-setting groups. Core rejects collisions; it does not use load order to choose a winner.

The stable itc_forms_tools_sections filter is additive: core Import, Export, Diagnostics, System updates, and Maintenance sections are immutable. This clarifies the security boundary for existing consumers that previously relied on incidental removal, replacement, or reordering behavior; register a vendor-prefixed additional section instead.

itc_forms_loaded( string $apiVersion ) fires on plugins_loaded at priority 0, after active plugin files are loaded and public PHP contracts are available. Register descriptor filters from this action so they are available before core registries are consumed.

itc_forms_initialized( string $apiVersion ) fires on init at priority 20, after ITC Forms registers its current-request runtime. Use it for integrations that require registered post types, blocks, or rewrite state; it is too late for descriptors consumed earlier during init.

Both actions fire once per request. They are not activation, per-site provisioning, or blog-switch events, and late plugin activation does not replay them in an already-running request.

Register form-owned data with itc_forms_form_extension_registry. Data is stored only under definition.extensions['vendor/name'] as a versioned { version, data } envelope. PHP normalize and optional validate callbacks are authoritative. Unknown, structurally valid namespaces remain inert and are preserved by ordinary saves and imports so reinstalling a companion can recover them; they are never executed or sent to the builder while unregistered.

Every descriptor declares portable, redact, duplicate, and privacy. Portable export includes only an active descriptor at its exact schema version with portable: true, after its redaction policy runs and the result passes the core portable-data boundary. Unknown, future-version, non-portable, removed, or failed-redaction data is omitted and the form receives an extension_data_omitted warning. Import accepts safe unknown envelopes and keeps them inert. An independent duplicate includes only exact-version active namespaces with duplicate: true; unknown data is intentionally not copied. Permanent form deletion already emits itc_forms_form_lifecycle_changed with the last normalized form record and a deleted target state, allowing an active companion to perform idempotent form-scoped cleanup.

The privacy policy has this shape:

'privacy' => [
'personalData' => true,
'export' => static function (string $email, int $page, int $limit): array {
return [
'items' => [[
'group_label' => __( 'CRM profile', 'acme-forms' ),
'data' => [['name' => __( 'Plan', 'acme-forms' ), 'value' => 'Basic']],
]],
'done' => true,
];
},
'erase' => 'extension',
'eraseCallback' => static fn (string $email, int $page, int $limit): string => 'removed',
'retention' => 'extension',
'retentionCallback' => static function (int $timestamp, int $limit): void {},
'uninstall' => 'extension',
],

personalData: true requires an exporter. Core accepts at most 50 records and 50 scalar fields in total across all records and all registered extensions per request, caps field values, creates item identifiers, and discards malformed callback output. Erasers return only none, removed, retained, or retry; they cannot inject messages into WordPress privacy responses. Retention callbacks receive the current timestamp and a maximum batch size of 50 once per retention run. Callbacks must be idempotent because WordPress can retry exports, erasures, and cron events. Exceptions and malformed returns fail closed and diagnostics contain only the namespace and reason.

Use personalData: false, erase: retain, and retention: inherit when a namespace stores form configuration rather than data-subject information. Core does not guess identity links inside companion tables. The companion must own those queries and callbacks. uninstall: extension is a declaration of companion ownership, not permission for ITC Forms to delete companion data; core retains data by default and a companion must implement and document its own uninstall choice.

Browser and REST mutations are narrower than trusted PHP imports. An editor may write only active namespaces at the registered version and only keys declared as builder controls. Omitted and byte-identical inactive envelopes are retained, but a forged new inactive namespace, a change to inactive data, or a write to a server-only key is rejected. Trusted portability imports continue to preserve structurally valid unknown envelopes as inert data.

Declare every key a builder panel edits as a builder control, even when a dedicated itcForms.builder.panels renderer shows it. Set the optional panel field to that panel’s key so core does not also list the controls in its generic Extension settings section; the save boundary is unchanged.

Builder defaults and submitted values must match their declarative controls: text and textarea values are bounded scalars, numbers must be finite numeric values, checkboxes are booleans, and selects must match a declared option. A fieldMap control holds a map of form-field keys (lowercase sanitize_key() output starting with a letter or digit) to text of at most 1,000 bytes, with at most 100 entries. Core never renders fieldMap controls in its generic list, so declare them only together with a panel that edits them. A submitted map replaces stored keys it names; it cannot remove stored keys it omits.

Every stored form passes through the registered normalize and validate callbacks when it is read, not only when it is saved. A validate failure makes the form unavailable, so add-ons that adopt a descriptor for data that was stored before the descriptor existed should normalize invalid values into safe, inert ones instead of rejecting them. Normalize keys missing from stored data to what the runtime did without them, not to new-form defaults. To stop an incomplete configuration from going live, register a readiness check under the same namespace key: it receives the namespace’s normalized data and an error blocks publishing without hiding stored forms (see the readiness section in php-hooks.md). Browser keys containing secret, token, password, credential, authorization, bearer, API-key, access-key, or private-key terms are rejected, including camelCase and separator variants.

normalize, validate, migrate, redaction, and privacy callbacks may run more than once in one request and may be retried in later requests. Keep them pure where possible and always idempotent; do not send mail, mutate remote state, or perform destructive cleanup from normalization or validation.

Custom fields require PHP and JavaScript registration. A field may use only declarative core controls, sanitizers, and validators. A custom operator also requires matching evaluators; PHP is authoritative.

add_filter( 'itc_forms_condition_operator_registry', function ( array $operators ): array {
$operators['acme_starts_with'] = [
'key' => 'acme_starts_with',
'label' => __( 'starts with', 'acme-forms' ),
'valueType' => 'text',
'evaluate' => static fn ( mixed $actual, mixed $expected ): bool =>
str_starts_with( (string) $actual, (string) $expected ),
];
return $operators;
} );
add_filter( 'itc_forms_field_type_registry', function ( array $types ): array {
$types['acme_company_code'] = [
'public' => true, 'control' => 'input', 'inputType' => 'text',
'sanitize' => 'text', 'validation' => 'text', 'maxLength' => 20,
'operators' => [ 'acme_starts_with', 'empty', 'not_empty' ],
];
return $types;
} );
wp.hooks.addFilter(
'itcForms.builder.conditionOperators', 'acme/company-operator',
( operators ) => ( {
...operators,
acme_starts_with: {
key: 'acme_starts_with', label: 'starts with', valueType: 'text',
evaluate: ( actual, expected ) =>
String( actual ?? '' ).startsWith( String( expected ?? '' ) ),
},
} )
);
wp.hooks.addFilter(
'itcForms.builder.fieldTypes', 'acme/company-field',
( types ) => ( {
...types,
acme_company_code: {
key: 'acme_company_code', label: 'Company code', control: 'input',
inputType: 'text',
operators: [ 'acme_starts_with', 'empty', 'not_empty' ],
},
} )
);

itc_forms_feed_providers accepts legacy descriptors, but new providers should use the core-owned managed lifecycle. ManagedAutomation::descriptor() creates the enqueue and processor callbacks while keeping repositories, claims, locks, retry scheduling, and terminal transitions inside ITC Forms. Browser-safe setting controls are text, textarea, email, url, number, checkbox, or select; credentials must never be browser-managed settings.

add_filter( 'itc_forms_feed_providers', function ( array $providers ): array {
$providers['acme_crm'] = \ItouchCode\Forms\ManagedAutomation::descriptor(
'acme_crm',
__( 'Acme CRM', 'acme-forms' ),
[[
'key' => 'list', 'label' => __( 'List', 'acme-forms' ),
'control' => 'text', 'default' => '',
]],
static function ( array $context ): string {
// Validate destination settings and minimize personal data sent.
return Acme_Crm_Client::send( $context ) ? 'succeeded' : 'retry';
}
);
return $providers;
} );

The handler context and its sensitivity rules are documented in extension-recipes.md.

itcForms.builder.feedProviders receives only PHP-registered providers. It may adjust custom safe metadata; it cannot add an unregistered provider or replace Email/Webhook.

Register panel metadata in PHP with itc_forms_builder_panel_registry, then a renderer with itcForms.builder.panels. A renderer receives a read-only form, the selected field, and updateForm(). Changes still pass the REST schema.

add_filter( 'itc_forms_builder_panel_registry', function ( array $panels ): array {
$panels['acme_crm'] = [ 'key' => 'acme_crm', 'label' => __( 'CRM', 'acme-forms' ) ];
return $panels;
} );
wp.hooks.addFilter( 'itcForms.builder.panels', 'acme/crm-panel', ( panels ) => [
...panels,
{ key: 'acme_crm', label: 'CRM', render: ( { form } ) =>
wp.element.createElement( 'p', null, `Form: ${ form.key || 'new' }` ) },
] );

Browser fills use itcForms.builder.slotFills with a unique key, slot, and render(context). Stable builder slots cover builder_canvas_toolbar, builder_selected_field_actions, builder_field_library_groups, builder_launch_readiness, builder_confirmation_configuration, builder_workflow_configuration, builder_automation_list, builder_provider_configuration, builder_notices, and builder_footer. The compatibility slots builder_header_after, builder_field_inspector_after, builder_form_inspector_after, builder_spam_protection_after, and builder_delivery_after retain their Extension API 1.0 context.

New display-only slots receive only a safe form identity/status summary, field and automation counts, and (where applicable) a minimal selected-field summary. They do not receive the complete form or a general form updater. Configuration slots additionally receive setExtensionValue(namespace, key, value, message?); it accepts only PHP-registered form-extension namespaces and controls and is normalized again by PHP during save. A fill cannot write core settings, other namespaces, feeds, field order, undo history, or save state.

PHP fires itc_forms_ui_slot( $slot, $context ) and itc_forms_ui_slot_{$slot}( $context ) for form_list_header_after, form_list_row_after, and entry_detail_after_values. Extensions escape PHP slot output.

itc_forms_form_action_registry and itc_forms_entry_action_registry accept key, label, capability, and callback. Form callbacks receive ( int $formId, array $form ); entry callbacks receive ( int $entryId, array $entry ). Core owns the URL, nonce, baseline ITC Forms capability, and descriptor capability. Core lifecycle keys are reserved.

add_filter( 'itc_forms_form_action_registry', function ( array $actions ): array {
$actions['acme_sync'] = [
'key' => 'acme_sync', 'label' => __( 'Sync CRM', 'acme-forms' ),
'capability' => 'manage_options',
'callback' => static function ( int $formId, array $form ): void {
Acme_Crm::sync_schema( $formId, $form['definition'] );
},
];
return $actions;
} );

itc_forms_delivery_lifecycle( string $transition, array $metadata ) fires only after a feed-run insert, claim, or terminal/retry update changes durable state. Transitions are queued, claimed, succeeded, retry_scheduled, and failed. There is no cancelled event until core has a real durable cancelled state. Metadata is limited to runId, entryId, provider, feedKey, status, attempts, errorCode, and nextAttemptAt; it never includes a claim token, destination, request body, entry values, credentials, or provider response.

Delivery workers can be retried after process termination. Consumers must be idempotent and should identify work by (runId, status, attempts). A stale claim or rejected compare-and-set update emits nothing. A callback exception is isolated after the database commit and cannot turn a successful core transition back into a failed one.

itc_forms_form_operation_completed( string $operation, int $formId, array $snapshot, array $context ) covers create, save, publish, draft, archive, restore, trash, untrash, duplicate, import, and delete. The snapshot contains only the local ID, immutable key, status, revision, field count, and automation count. Context may contain only the previous status, source form ID, or portable source key as relevant. Titles, definitions, extension data, delivery settings, destinations, and submitted values are not passed. Import events are deferred until the complete batch succeeds; a rejected or rolled-back batch emits no successful import event.

The older itc_forms_form_saved, itc_forms_form_lifecycle_changed, and itc_forms_portable_form_imported hooks remain available for Extension API 1.0 compatibility. New integrations should prefer the bounded operation event when they do not need a legacy full-form payload.

itc_forms_submission_stage( string $stage, array $context ) is the stable observational contract shared by managed forms and legacy version-0 forms. A successful request emits these stages in order:

  1. accepted
  2. core_normalized
  3. extension_normalized
  4. validation
  5. spam
  6. storage_decided
  7. persistence
  8. automations_selected
  9. automations_queued
  10. completion

Early rejection stops at the authoritative boundary. An early local-spam decision emits the intervening normalization and validation stages with a skipped outcome before the spam rejection, preserving ordering without claiming those transformations ran. Stored and transient managed submissions both reach completion; context identifies the storage decision without including submission data.

Context is built from scratch and may contain only pipeline, formKey, outcome, numeric form/entry IDs, storage, a confirmation category, bounded validation error keys, and bounded selected automation keys. It never contains raw request data, field values, names, email addresses, uploaded files, challenge tokens, confirmation copy, redirect URLs, destinations, credentials, or provider responses. Observers cannot transform the pipeline, and observer exceptions are isolated. The existing normalization/storage filters and itc_forms_submission_completed, itc_forms_submission_rejected, and itc_forms_entry_created actions remain compatible.

If itc_forms_submission_values_normalized throws, core discards staged files, records only a redacted extension diagnostic, emits a failed extension_normalized stage with the generic extension key, and follows the visitor-safe error redirect. It does not persist values or queue automations.

itc_forms_entry_workflow_state_registry adds vendor/state descriptors with a plain label, semantic tone (neutral, info, warning, success, or error), visibility (admin, owner, or both), and terminal flag. Core states are immutable. Stored namespace columns are 191 bytes wide; invalid or unknown states are never coerced into a core state.

itc_forms_entry_event_type_registry adds append-only vendor/event activity types with a label, category, and at most 20 allowlisted scalar change keys. Core event types cannot be removed or replaced. Extension events discard note text and bound every change value. The legacy activity-timeline filter remains compatible for additive display records but can no longer remove or rewrite persisted authoritative events.

itc_forms_entry_workflow_transition_registry descriptors declare a namespaced key, label, optional bounded plain-text confirmation, allowed source states, registered target state, capability, availability callback, mutation callback, and registered event type. Both callbacks receive only entry ID, form key, ordinary entry status, workflow state, and workflow revision—never values, identity fields, notes, uploads, or delivery data. They must return strict true.

Core verifies its entry-management capability, the descriptor capability, POST nonce, reloaded entry ID, revision, source state, and target registration inside the locked operation. Core then owns the state/revision update and append-only event. Exceptions, stale revisions, unavailable transitions, non-true callback results, invalid event types, and audit-write failures roll back and use the existing fixed conflict response. Successful requests redirect to a core-generated URL with a fixed success notice; callbacks cannot choose messages or destinations.

itc_forms_entry_bulk_action_registry is separate from single-entry actions. Descriptors contain a namespaced key, label, capability, bounded maxBatch, and callback. Core caps IDs at 100, verifies the baseline and descriptor capabilities, action nonce, and each entry ID/revision nonce, then reloads every entry before invoking the callback with a PII-free summary. Results are partial: each record receives durable intent and completion/failure activity and the admin notice reports completed and failed counts. Callbacks must return strict true; they never receive entry values, notes, uploads, requests, or a redirect.

Entry actions remain server-rendered so private entry data is never localized. Builder-only actions belong in a documented slot fill and cannot bypass save schema rules.

itc_forms_default_definition receives ( array $definition, string $context, string $apiVersion ); context is blank or template:{key}. itc_forms_default_email_feed receives ( array $feed, string $purpose, string $apiVersion ); purpose is administrator_notification or submitter_confirmation. Both pass authoritative normalization; invalid return types fall back.

The built-in catalog keys are blank, contact, appointment-request, enquiry, registration, newsletter, and feedback. Each localized catalog record includes templateVersion, storage/email disclosure copy, and a normal schema-v6 definition. The recipe version is not a runtime dependency: after selection, extensions and editors work on an independent form definition.

add_filter(
'itc_forms_default_definition',
static function (array $definition, string $context): array {
if ($context === 'template:appointment-request') {
$definition['settings']['retentionDays'] = 30;
}
return $definition;
},
10,
2
);

itc_forms_validation_errors continues to add field keys or form. Its old documented associative field => message shape is a deprecated bridge. Copy now belongs in itc_forms_validation_feedback( $messages, $errorKeys, $definition ); unknown/non-error keys are ignored and core escapes output.

add_filter( 'itc_forms_validation_feedback', function ( array $messages, array $errors ): array {
if ( in_array( 'company_code', $errors, true ) ) {
$messages['company_code'] = __( 'Use the format ABC-1234.', 'acme-forms' );
}
return $messages;
}, 10, 2 );