Gatemi Product Tabs Developer Reference

Shared data

_gmpt_tabs (post meta on a product)

Both editions read and write it. A list of rows:

array(
	array( 'title' => 'Size guide', 'content' => '<table>…</table>' ),
	array( 'title' => 'Care',       'content' => 'Wash at 30°.' ),
)

Rows without a title are dropped on read and save. Content is wp_kses_post()-filtered on save and on render. To write tabs from an import, store this shape directly:

update_post_meta( $product_id, '_gmpt_tabs', array(
	array( 'title' => 'Warranty', 'content' => 'Two years, parts and labour.' ),
) );

Free edition

The free edition applies no filters or actions of its own. It hooks woocommerce_product_tabs at priority 30 and adds up to three tabs with the keys gmptf_0, gmptf_1, gmptf_2 at priorities 40, 45 and 50.

Item Value
Product data section gmptf, panel gmptf_product_tabs_panel
Posted field gmptf_tabs[n][title], gmptf_tabs[n][content]
Options none

Full edition

Tab keys

Key Tab
gmpt_product_0, gmpt_product_1, … The product's own tabs, priority 40, 45, …
gmpt_global_{post ID} A global tab, priority = after the last product tab + its sort offset

WooCommerce's own keys description, additional_information and reviews are removed when switched off.

Filters

gmpt_tabs

The final tab array handed to WooCommerce, after this plugin's additions. Applied only while Show custom tabs on product pages is on and a product is in scope.

Argument Type
$tabs array WooCommerce's tab array
$product_id int The product
// Put the global "Delivery" tab first.
add_filter( 'gmpt_tabs', function ( $tabs, $product_id ) {
	if ( isset( $tabs['gmpt_global_123'] ) ) {
		$tabs['gmpt_global_123']['priority'] = 5;
	}
	return $tabs;
}, 10, 2 );

gmpt_tab_content

A tab's rendered content (after shortcodes, wpautop() and wp_kses_post()), before output.

Argument Type
$rendered string The HTML to print
$content string The stored content

What you return is printed as is, so escape anything you add.

gmpt_settings

The defaults-merged settings array before use.

gmpt_modules

The plugin's module list before registration.

gmpt_license_api_url, gmpt_update_cache_ttl

The licence API base URL and how long the update response is cached, in seconds.

Actions

gmpt_booted

Fires after every module has booted. Receives the plugin's service container.

Storage

Item Name
Settings option gmpt_settings — enabled, core_description, core_additional, core_reviews, each yes/no
Licence option gmpt_license
Update cache transient gmpt_update_payload
Cron gmpt_license_check (twice daily, only with a key)
Post type gmpt_tab — private, shown under Products, uses product capabilities
Global tab meta _gmpt_all_products (yes/no), _gmpt_categories (term IDs), _gmpt_priority (0–100)

CSS

The plugin prints no markup of its own on the storefront. Each tab is rendered by your theme; WooCommerce gives a tab the classes {key}_tab on its title (for example gmpt_product_0_tab) and the panel the id tab-{key}, which you can target:

#tab-gmpt_global_123 table { width: 100%; }
Shopping Cart
Scroll to Top