WP Webhooks / Docs / Code Glue
Feature since v1.12.0

Code Glue

Attach short PHP snippets per webhook+trigger to enrich payloads before dispatch.

$

Free from 3.0.0 — Code Glue shipped in Webhook Actions Pro (Pro 1.1.0, alongside free 1.12.0) and is now part of the free plugin, with no licence check on it or on the abilities that drive it. Write a pre-dispatch PHP snippet in the admin panel and attach it to a webhook+trigger combination. The snippet runs after payload mapping and can read WordPress data, look up post meta, call internal functions, or reshape fields without touching theme or plugin files.

Available variables

$payload — the mapped payload array. $args — shortcut to $payload['args'], the original hook arguments. It is empty when the field mapping excludes unmapped fields — map what you need through and read it from $payload.

Shorthand syntax

Curly-brace placeholders resolve to array access for any variable: {{ $args.0.field }} → $args[0]['field'], {{ $payload.key }} → $payload['key'].

Return value

Return the array to send (return $payload;) — the returned array replaces the payload before dispatch. A non-array return leaves the payload unchanged.

/ Examples

Look up and inject a HubSpot deal ID from post meta

// Available: $payload (mapped array), $args ($payload['args'])
$order_id = $payload['order_id'] ?? 0;
$hs_deal_id = get_post_meta( $order_id, '_hs_deal_id', true );
$payload['hs_deal_id'] = $hs_deal_id;
return $payload;

/ Related

Ready

Your next automation is
one sentence away.

$ wp plugin install flowsystems-webhook-actions --activate