Gatemi Wishlist Developer Reference

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

Filters — Full edition

gmwl_max_lists

How many lists one shopper may keep while Let shoppers keep more than one list is on. Default 20, minimum 1. With the setting off, the answer is always 1 and the filter is not applied.

add_filter( 'gmwl_max_lists', function () {
	return 5;
} );

gmwl_share_url

The public address a shared list is reached at.

Argument Type
$url string The wishlist page with gmwl_share added
$list array The list row: id, owner_key, title, share_key, created_at

gmwl_settings

The merged settings array: on_product, on_archives, allow_guests, multiple_lists, sharing, page_id, button_label.

Other filters

Filter What it tunes
gmwl_modules The ordered module list the plugin boots
gmwl_license_api_url The gatemi.com licensing endpoint
gmwl_update_cache_ttl How long the update payload is cached, in seconds

Actions — Full edition

Action Arguments When
gmwl_booted $container After every module has booted

Shortcodes

Shortcode Edition Renders
[gatemi_wishlist] Both The visitor's wishlist, or a shared one when the address carries a share key
[gatemi_wishlist_count] Full <span class="gmwl-count"> with the number of products on the visitor's first list, linked to the wishlist page when one is chosen. Kept up to date by the script after a save.

Neither takes attributes.

wc-ajax endpoints

All are POST to WooCommerce's AJAX endpoint (/?wc-ajax=<action>) and need nonce — a nonce for the action gmwlf_action (free) or gmwl_action (full). The storefront script receives it as gmwlfData.nonce / gmwlData.nonce.

Action Edition Fields Answer
gmwlf_toggle / gmwl_toggle Free / Full product, (full) list saved (bool), count, button (markup). Errors: invalid_nonce (403), invalid_product (400), login_required (403).
gmwlf_remove / gmwl_remove Free / Full product, (full) list removed: true
gmwl_create_list Full title list (new id), or limit_reached (400) with a message

A creates-a-list example for a theme:

const body = new URLSearchParams( { nonce: gmwlData.nonce, title: 'Birthday' } );
fetch( gmwlData.ajaxUrl.replace( '%%endpoint%%', 'gmwl_create_list' ), {
	method: 'POST', credentials: 'same-origin', body,
} ).then( ( r ) => r.json() );

Passing list to gmwl_toggle saves into that list, if the visitor owns it. Without list, a save goes to the first list, and a toggle on an already-saved product removes it from every list.

Printing the button yourself

Neither edition offers a function or shortcode for the button alone; it is printed on the two WooCommerce hooks named in Getting started. The storefront script wires any element by its data attributes, so a theme can print its own:

<button type="button" class="gmwl-button" data-gmwl-toggle="1"
	data-gmwl-product="<?php echo esc_attr( $product->get_id() ); ?>"
	aria-pressed="false">Save for later</button>

Use data-gmwlf-toggle / data-gmwlf-product and the gmwlf- class in the free edition. After a save, the script replaces the element with the plugin's own button markup, so your wording only lasts until the first press.

Database tables

Free edition — {prefix}gmwlf_items:

Column
id Primary key
owner_key user:{id} or guest:{token}
product_id The product
share_key The owner's share key, repeated on each row
added_at GMT datetime

UNIQUE KEY owner_product (owner_key, product_id), KEY product_id. Schema version in gmwlf_db_version.

Full edition — {prefix}gmwl_lists (id, owner_key, title, share_key UNIQUE, created_at) and {prefix}gmwl_items (id, list_id, product_id, added_at, UNIQUE KEY list_product (list_id, product_id)). Schema version in gmwl_db_version.

Options, cookies and query arguments

Name Kind Edition
gmwlf_settings Option Free
gmwl_settings, gmwl_license Options Full
gmwlf_guest / gmwl_guest Cookie, 90 days, HttpOnly Free / Full
gmwlf_share / gmwl_share Query argument: share key Free / Full
gmwl_list Query argument: list to show Full

Transient gmwl_update_payload and the cron event gmwl_license_check belong to the full edition's licence client.

CSS classes worth styling

Free edition classes start gmwlf-, full edition gmwl-.

Class Element
.gmwlf-button / .gmwl-button The save button
--saved, --login modifiers Saved state; the Log in to save link
-button-icon, -button-label Heart icon and words
-page, -items, -item Wishlist page, list, row
-item-image, -item-name, -item-price, -item-stock, -item-stock--out, -item-add, -item-remove Row parts
-share, -share-label, -share-url Share box
-empty Empty-list message
.gmwl-switcher, .gmwl-switcher-tab, --current, .gmwl-list-title Full: list tabs and title
.gmwl-counter, .gmwl-count Full: the count shortcode

The wishlist page's add-to-cart link also carries button wp-element-button, so a block theme styles it as its own button.

Constants

Constant Edition
GMWLF_VERSION, GMWLF_PLUGIN_FILE, GMWLF_PLUGIN_DIR, GMWLF_PLUGIN_URL Free
GMWL_VERSION, GMWL_PLUGIN_URL Full

The free edition stands down whenever GMWL_VERSION is defined.

Shopping Cart
Scroll to Top