Gatemi Thank You Developer Reference

The free edition applies no filters of its own. Everything under Filters and Actions is the full edition's.

Filters — Full edition

gmty_settings

The merged settings array after defaults. One key: enabled (yes/no).

gmty_layouts

The layouts as read from storage, after normalisation.

Argument Type
$layouts array List of layouts: name, scope, targets, blocks

gmty_layout

The layout chosen for one order. Return null to leave WooCommerce's own page for that order. A layout returned with no blocks is treated as null.

Argument Type
$layout array|null The first matching layout
$order WC_Order The order
// No custom page for orders paid by bank transfer.
add_filter( 'gmty_layout', function ( $layout, $order ) {
	return 'bacs' === $order->get_payment_method() ? null : $layout;
}, 10, 2 );

The filter runs only on the layout that matched; returning null does not fall through to the next layout.

gmty_block_types

The block kinds a layout may contain. Each entry is keyed by kind and holds label, description, text (bool, uses the text field) and value (bool, uses the value field). A kind you add here is accepted by the editor and storage; draw it with gmty_render_block.

gmty_render_block

One block's markup. The default for a kind the plugin does not draw is an empty string.

Argument Type
$html string The plugin's markup for the block
$block array kind, text, value
$order WC_Order The order
add_filter( 'gmty_block_types', function ( $types ) {
	$types['review_link'] = array(
		'label'       => 'Review link',
		'description' => 'A link to leave a review.',
		'text'        => true,
		'value'       => true,
	);
	return $types;
} );

add_filter( 'gmty_render_block', function ( $html, $block, $order ) {
	if ( 'review_link' !== $block['kind'] ) {
		return $html;
	}
	return '<p class="gmty-review"><a href="' . esc_url( $block['value'] ) . '">'
		. esc_html( wp_strip_all_tags( $block['text'] ) ) . '</a></p>';
}, 10, 3 );

The text you receive is the raw stored text; placeholders are filled only for the built-in kinds.

gmty_placeholders

The placeholder values for one order, as '{token}' => 'value'. Add a key to add a placeholder to every block.

Argument Type
$values array Placeholder → value
$order WC_Order|null The order
add_filter( 'gmty_placeholders', function ( $values, $order ) {
	$values['{billing_city}'] = $order ? $order->get_billing_city() : '';
	return $values;
}, 10, 2 );

Other filters

Filter What it tunes
gmty_modules The ordered module list the plugin boots
gmty_license_api_url The gatemi.com licensing endpoint (staging mirrors)
gmty_update_cache_ttl How long the update payload is cached, in seconds

Actions — Full edition

Action Arguments When
gmty_booted $container After every module has booted

Hooks the plugin uses

Hook Priority What it does
woocommerce_thankyou 5 Prints the layout
woocommerce_thankyou → woocommerce_order_details_table 10 Removed for that request only when the layout carries the details block
wp_enqueue_scripts 10 Registers the stylesheet
wp_footer 10 Enqueues the stylesheet if a layout was drawn

Options

Option Edition Holds
gmty_settings Both ['enabled' => 'yes'|'no']
gmty_layouts Both List of layouts
gmty_license Full Licence state

A layout:

array(
	'name'    => 'Machine buyers',
	'scope'   => 'categories',   // all | products | categories
	'targets' => array( 14 ),    // product or category ids
	'blocks'  => array(
		array( 'kind' => 'heading', 'text' => 'Thank you, {first_name}!', 'value' => '' ),
		array( 'kind' => 'video',   'text' => '', 'value' => 'https://youtu.be/abcdefgh' ),
		array( 'kind' => 'details', 'text' => '', 'value' => '' ),
	),
)

Block kinds: heading, text, details, button (both editions); steps, coupon, video (full edition).

Transient gmty_update_payload and cron event gmty_license_check belong to the full edition's licence client.

The plugin writes no post meta, no order meta and no database table.

CSS classes

The stylesheet (gmty in the full edition, gmtyf in the free one) is loaded only on a request that drew a layout. Classes worth styling:

Class Element
.gmty Wrapper around every block
.gmty-heading Heading <h2>
.gmty-text Paragraph block
.gmty-details Wrapper around WooCommerce's order details
.gmty-button-wrap, .gmty-button Button paragraph and link
.gmty-steps, .gmty-step Full edition: list and items
.gmty-coupon, .gmty-coupon-text, .gmty-coupon-code Full edition: coupon block
.gmty-video Full edition: video wrapper

The free edition's button also carries wp-element-button, so a block theme styles it as its own button. The full edition's button carries button gmty-button only.

Constants

Constant Edition
GMTYF_VERSION, GMTYF_FILE, GMTYF_PATH, GMTYF_URL Free
GMTY_VERSION, GMTY_PLUGIN_URL Full

The free edition stands down whenever GMTY_VERSION is defined.

Shopping Cart
Scroll to Top