---
title: Hooks and filters
description: The filters Gemelune provides, with examples.
url: "https://wpruby.com/knowledgebase/gemelune-hooks/"
updated: "2026-11-04"
category: WPRuby Themes / Gemelune
---

# Hooks and filters

Gemelune provides the filters below. Put the code in the [child theme](https://wpruby.com/knowledgebase/gemelune-child-themes/)'s `functions.php` or in a small plugin.

Table of Contents

 [Toggle](#)

- [gemelune_swatch_attributes](#gemelune_swatch_attributes)
- [gemelune_size_guide_attributes](#gemelune_size_guide_attributes)
- [gemelune_info_pages](#gemelune_info_pages)
- [gemelune_new_badge_days](#gemelune_new_badge_days)
- [gemelune_card_hover_image](#gemelune_card_hover_image)
- [gemelune_thumbnail_ratio](#gemelune_thumbnail_ratio)
- [gemelune_filter_chip_attributes](#gemelune_filter_chip_attributes)
- [gemelune_newsletter_form](#gemelune_newsletter_form)
- [gemelune_link](#gemelune_link)
- [gemelune_footer_links](#gemelune_footer_links)
- [gemelune_admin_help_links](#gemelune_admin_help_links)

## `gemelune_swatch_attributes`

The attributes shown as colour swatches. Default `pa_metal`, `pa_metal-color`, `pa_metal-colour`, `pa_color` and `pa_colour`.

```
add_filter( 'gemelune_swatch_attributes', function ( $taxonomies ) {
	$taxonomies[] = 'pa_finish';
	return $taxonomies;
} );
```

## `gemelune_size_guide_attributes`

The attributes that get the **Size guide** link. Default `pa_ring-size`, `pa_size`, and the custom attribute names `ring-size` and `ring size`.

## `gemelune_info_pages`

The slugs of your information pages, by key: `size-guide` (`ring-size-guide`), `delivery` (`delivery-returns`) and `care` (`jewelry-care`).

```
add_filter( 'gemelune_info_pages', function ( $slugs ) {
	$slugs['delivery'] = 'shipping';
	return $slugs;
} );
```

## `gemelune_new_badge_days`

How many days after publishing a piece shows the **New** badge. Default `30`; `0` turns the badge off.

## `gemelune_card_hover_image`

Whether a product card shows the second gallery image on hover. Default `true`. The second argument is the `WC_Product`.

```
add_filter( 'gemelune_card_hover_image', '__return_false' );
```

## `gemelune_thumbnail_ratio`

The height-to-width ratio of catalog images. Default `1.25` (4:5 portrait); `1` makes them square.

## `gemelune_filter_chip_attributes`

The attribute slugs whose filter options show as chips instead of a checklist. Default `ring-size`, `size`, `necklace-length` and `length`.

## `gemelune_newsletter_form`

The newsletter form's HTML. Gemelune returns MailPoet's first form when MailPoet is active, and an empty string otherwise. Return your provider's form to show it in the homepage newsletter section and the footer:

```
// A Mailchimp for WordPress form, through its shortcode.
add_filter( 'gemelune_newsletter_form', function () {
	return do_shortcode( '' );
} );
```

When the filter returns an empty string, no form is shown.

## `gemelune_link`

The URL a homepage section links to, found by slug. Arguments: the URL (empty when nothing matched), the type (`page` or a taxonomy such as `product_cat`) and the slug.

```
// Send the Rings card to a page instead of the category.
add_filter( 'gemelune_link', function ( $url, $type, $slug ) {
	return ( 'product_cat' === $type && 'rings' === $slug ) ? home_url( '/rings-guide/' ) : $url;
}, 10, 3 );
```

## `gemelune_footer_links`

The links in a footer column, as a list of `array( label, url )`. The second argument is the column: `shop`, `care`, `house` or `legal`.

## `gemelune_admin_help_links`

The Documentation, Get support and Your WPRuby account links on **Appearance → Gemelune**, as an array with the keys `docs`, `support` and `account`.
