Hooks and templates

Last updated: September 2026, plugin 1.5.2

Every filter and action the free plugin exposes, with its signature and purpose, followed by the templates a theme can override and the variables each receives. Generated from the docblocks in includes/; the prefix is wbs_dataverse_connect_ throughout.

Filters

Collections and reading

FilterArgumentsPurpose
wbs_dataverse_connect_collections$collectionsRegister collections in code (key => config); settings-page collections with the same key override them.
wbs_dataverse_connect_normalize_collection$clean, $key, $configLast stop of collection normalization; add-ons carry extra config keys through here.
wbs_dataverse_connect_field_label$label, $column, $configThe label of a column in cards, detail tables and the toolbar, after metadata and the heuristic.
wbs_dataverse_connect_record_vm$vm, $config, $recordThe view model of one record before the templates print it (id, name, slug, url, image, fields, files, record).
wbs_dataverse_connect_access_filter$expression, $config, $scopeOData expression ANDed into every read of a collection; $scope is list or single. Empty by default.
wbs_dataverse_connect_can_view$allowed, $config, $scopeGate a collection, record, form or media file for the current visitor; $scope is collection, record, form or media.
wbs_dataverse_connect_denied_notice$html, $config, $scopeMarkup shown when can_view refused; add-ons replace it with a sign-in prompt.
wbs_dataverse_connect_metadata_ttl$secondsHow long table metadata stays cached. Default one day.
wbs_dataverse_connect_metadata_attributes$attrs, $table, $contextThe attribute map of a table after fetching (label, type, required, format, maxlength, options, targets).

Forms and writing

FilterArgumentsPurpose
wbs_dataverse_connect_forms$formsRegister forms in code (key => config); settings-page forms override them.
wbs_dataverse_connect_normalize_form$clean, $key, $configLast stop of form normalization; add-ons carry extra config keys through here.
wbs_dataverse_connect_form_view$view, $config, $recordThe view model of a rendered form: fields with labels, options and values, mode, record id, Turnstile site key.
wbs_dataverse_connect_form_record$record, $config, $valuesLast stop before the write: the column => value payload; $config['mode'] tells a create from an update.
wbs_dataverse_connect_bridge_maps$mapsWBS Forms bridge maps keyed by form slug.
wbs_dataverse_connect_bridge_record$record, $map, $submission, $form_idLast stop before a bridged create.

Connection, admin and settings

FilterArgumentsPurpose
wbs_dataverse_connect_connection$conn, $contextThe connection (tenant_id, client_id, client_secret, env_url, auth) used for the request described by $context (type collection, form, admin or metadata, plus config).
wbs_dataverse_connect_token_args$args, $connThe wp_remote_post args of the token request; swap the client secret for a certificate assertion here.
wbs_dataverse_connect_admin_tabs$tabsSettings page tabs (slug => label); render an added tab with the render_tab_{slug} action.
wbs_dataverse_connect_save_collection$config, $postThe collection config about to be stored, with the unslashed POST data for extra rows.
wbs_dataverse_connect_save_form$config, $postSame for forms.
wbs_dataverse_connect_blocks_data$dataData handed to the block editor: collections and forms as value/label pairs, settings URLs.
wbs_dataverse_connect_review_due$dueReturn false to keep the one-time review request off a site.

Health, media and webhooks

FilterArgumentsPurpose
wbs_dataverse_connect_alert_recipients$toEmail addresses failure and recovery alerts go to.
wbs_dataverse_connect_alert_cooldown$secondsWait before re-alerting about the same failure episode. Default six hours.
wbs_dataverse_connect_media_ttl$secondsHow long proxied images and files are cached, in the transient and via Cache-Control. Default one day.
wbs_dataverse_connect_media_max_bytes$bytesUpper bound of one proxied file. Default 32 MB.
wbs_dataverse_connect_media_inline_types$inlineMIME types served inline; everything else is downloaded as an attachment.
wbs_dataverse_connect_webhook_payload$payload, $event, $hookThe message about to be posted ({event, site, time, data}); $hook is the receiving webhook, null for a preview.
wbs_dataverse_connect_webhook_args$args, $hook, $eventThe wp_remote_post args of a delivery, before the body is signed.

Actions

ActionArgumentsFires
wbs_dataverse_connect_record_created$key, $entity_set, $id, $recordAfter a form or the bridge created a record; $key is the form key or bridge:<slug>.
wbs_dataverse_connect_record_updated$key, $entity_set, $id, $recordAfter an update-mode form patched a record.
wbs_dataverse_connect_bridge_created$id, $form_id, $recordAfter the WBS Forms bridge wrote a submission (older companion of record_created).
wbs_dataverse_connect_health_event$kind, $stateOn every recorded failure and every recovery; $kind is failure or recovery.
wbs_dataverse_connect_webhook_dispatched$event, $data, $sentAfter an event was handed to its webhooks, with the number of deliveries.
wbs_dataverse_connect_collection_fields$editingInside the collection editor's table, before the submit button; $editing is the config or null when adding.
wbs_dataverse_connect_form_fields$editingSame for the form editor.
wbs_dataverse_connect_render_tab_{slug}noneRenders the content of a tab added through admin_tabs.

The bridge consumes wbs_forms_after_submit($form_id, $fields, $meta) from WBS Forms and answers the wbs_forms_submission_handled filter with true after a successful create.

Client functions

Add-ons and theme code use the same client the plugin uses. Every read goes through the cache and the health monitor; writes are never cached. The request functions return the decoded array or a WP_Error; the helpers below return what their row says.

FunctionPurpose
wbs_dataverse_connect_get($path, $ttl = null, $context = [])Cached GET relative to the API base; $ttl null is the site default, 0 skips the cache; $context['headers'] merges extra request headers.
wbs_dataverse_connect_post($path, $body, $context = [])Create. Returns ['id' => guid].
wbs_dataverse_connect_patch($path, $body, $context = [])Update of one addressed record such as contacts(guid); pass ['headers' => ['If-Match' => '*']] to forbid upserts.
wbs_dataverse_connect_get_raw($path, $context = [])Raw bytes of a $value request, for media; returns body, type, name and status.
wbs_dataverse_connect_typed_value($field, $raw, $context = [])Type one submitted value for the Web API by a normalized field spec; null for empty, WP_Error for invalid.
wbs_dataverse_connect_render_form($config, $record_id = '')Render a form bound to a record.
wbs_dataverse_connect_template($name, $vars = [])Load a template with theme override.

Templates

Templates live in wbs-connect-for-dataverse/templates/. Copy a file to your-theme/wbs-connect-for-dataverse/ (child themes work) and edit the copy. Variables are extracted into the template scope; everything in a view model is pre-formatted, the template only escapes and prints.

TemplateVariables
collection-list.php$cards (pre-rendered card HTML), $columns (1 to 4)
collection-card.php$vm: id, name, slug, url (detail link or empty), image, fields (list of column, label, value), files, record (the raw row)
collection-toolbar.php$toolbar: action, hidden (name => value inputs), search (null or name, id, value, label), filters (list of column, name, id, label, options, value), sort (null or name, id, options, value, label), count (int or null), active, reset_url
collection-pagination.php$pagination: page, has_prev, has_next, prev_url, next_url, count
record-detail.php$vm as above, with files as a list of column, label, url, name; $form (pre-rendered form HTML or empty)
form.php$config (normalized form config), $record_id (GUID or empty), $rest_url, $nonce; the template calls wbs_dataverse_connect_form_view() for the typed fields

Front-end classes are prefixed dvc-. The form's submit handler in assets/wbs-connect-for-dataverse.js reads the data-dvc-* attributes of the form element, so a custom form.php keeps working as long as it keeps them.

See also