The shared FAQ filters (both editions)
These two filters carry the family-neutral gatemi_faq_schema_ prefix and are the same in Gatemi Product Info and Gatemi Product Questions, both editions of each.
gatemi_faq_schema_owner
apply_filters( 'gatemi_faq_schema_owner', '' )
Who prints the one FAQPage block. Product Info answers gatemi-product-info — always in the free edition, and in the full edition while Describe the questions to search engines is on. Any value other than '' means somebody prints the block, so other plugins should only add to the item list.
gatemi_faq_schema_items
apply_filters( 'gatemi_faq_schema_items', $items, $product )
| Argument | Type | |
|---|---|---|
$items |
array |
A list of array( 'question' => string, 'answer' => string ), plain text. Product Info's own questions come first. |
$product |
WC_Product |
The product on the page. |
Product Info applies it once, in wp_footer, then keeps only well-formed pairs whose question and answer are both non-empty after tags are stripped. If the list is empty, no block is printed.
// Add a store-wide delivery question to every product's FAQ block.
add_filter( 'gatemi_faq_schema_items', function ( $items, $product ) {
$items[] = array(
'question' => 'How long does delivery take?',
'answer' => 'Two to four working days in the UK.',
);
return $items;
}, 30, 2 );
Only add questions the page actually shows. Structured data that does not match visible content can cost the rich result.
Free edition
The free edition applies no filters of its own besides the shared one above.
| What | Name |
|---|---|
| Product meta | _gmpi_chart, _gmpi_faq, _gmpi_video |
| Product tabs | gmpif_chart (priority 25), gmpif_faq (priority 30) |
| Product data tab | gmpif → panel gmpif_product_data |
| Hooks used | woocommerce_product_tabs (20), woocommerce_product_thumbnails (20, the video), wp_footer (the schema) |
| Options | none |
Full edition: filters
| Filter | Arguments | What it tunes |
|---|---|---|
gmpi_records |
$records |
The reusable charts, FAQ sets and videos, after they are read. |
gmpi_settings |
$settings |
The merged settings. |
gmpi_modules |
$modules |
The module list. |
gmpi_license_api_url, gmpi_update_cache_ttl |
— | The licence endpoint and update cache lifetime. |
Each record is array( 'id', 'kind' => 'chart'|'faq'|'video', 'title', 'enabled' => 'yes'|'no', 'content', 'applies_to' => 'all'|'products'|'categories', 'products' => int[], 'categories' => int[] ).
// Use a different size chart record for wholesale customers.
add_filter( 'gmpi_records', function ( $records ) {
if ( ! in_array( 'wholesale_customer', (array) wp_get_current_user()->roles, true ) ) {
return $records;
}
return array_values( array_filter( $records, function ( $record ) {
return 'retail-chart' !== $record['id'];
} ) );
} );
Full edition: actions
| Action | Arguments | When |
|---|---|---|
gmpi_booted |
$container |
The plugin has finished booting. |
Full edition: data
| What | Name |
|---|---|
| Options | gmpi_records, gmpi_settings (chart_display, chart_title, faq_title, chart_link, video_in_gallery, faq_schema), gmpi_license |
| Product meta | _gmpi_chart, _gmpi_faq, _gmpi_video (the same as the free edition) |
| Product tabs | gmpi_chart (25), gmpi_faq (30) |
| Cron | gmpi_license_check |
| Transient | gmpi_update_payload |
CSS classes
Free edition: .gmpif-chart, .gmpif-faqs, .gmpif-faq, .gmpif-faq-question, .gmpif-faq-answer, .gmpif-video.
Full edition: the same with the gmpi- prefix, plus the popup — .gmpi-chart-link, .gmpi-modal, .gmpi-modal-backdrop, .gmpi-modal-box, .gmpi-modal-title, .gmpi-modal-close.
