Ir al contenido

Configuration

Esta página aún no está disponible en tu idioma.

Trust has one settings screen, WooCommerce → Trust Badges, and everything is stored in a single trust_settings option (an array). The screen is split into a Display card and a Badges card. Trust ships enabled with sensible defaults, so configuration is optional.

enabled, the master switch, on by default. When off, no badge row and no stylesheet load anywhere on the storefront, including the shortcode; the front end is completely unaffected. Your saved heading, colour and badge selection are kept for when you turn it back on.

show_on_product, on by default. Controls whether the row is hooked onto woocommerce_after_add_to_cart_form (after the add-to-cart button) on single product pages. Turn it off to keep the badges out of the product template and place them yourself with [trust_badges], for example in a footer or a block. The master toggle still has to be on for the shortcode to output anything.

heading, the short line shown above the badges, defaulting to Guaranteed safe checkout. Leave it empty to render the icons on their own with no heading element. The field has an inline preview beside it so you can see the wording at a glance. Saved through sanitize_text_field.

icon_color, a native colour picker (<input type="color">), default #3c4858. It tints both the icons and the heading. The value is applied to the storefront as an inline CSS custom property (--trust-seal) on the badge container, so a colour change never regenerates a stylesheet. Saved through sanitize_hex_color; an empty or invalid value falls back to the default rather than being stored.

badges, an ordered list of slugs picked from the bundled library. The checklist shows all ten:

Slug Badge
secure_checkout Secure checkout (lock)
ssl_encrypted SSL encrypted
money_back Money-back guarantee
verified Verified / trusted store
free_shipping Free shipping (truck)
card_payment Card payment
wallet Digital wallet
support 24/7 support (headset)
privacy Privacy protected
satisfaction Satisfaction (thumbs up)

Four are ticked out of the box: secure_checkout, ssl_encrypted, money_back, card_payment. On save, only known slugs survive, unknown values are dropped and duplicates removed, so the stored list is always valid against the library. All ten are hand-authored inline SVGs with no third-party logos, which keeps them clear of trademark rules and external requests.

The library labels (for example Secure checkout (lock)) are used as the badge’s accessible name on the storefront, not as visible captions; the storefront row shows icons only.

A few behaviours are deliberately not settings:

  • The product-page row always renders after the add-to-cart button (woocommerce_after_add_to_cart_form), there is no before/cart/checkout placement.
  • The row outputs nothing when the plugin is disabled or when no badges are selected, so a half-configured screen never prints broken markup.
  • The storefront is CSS-only; no script is enqueued on the front end.

Settings pass through one filter before they are saved, so you can pin or adjust values in code:

add_filter( 'trust_sanitize_settings', function ( array $settings, $raw ) {
// Force the icon colour to your brand value regardless of the picker.
$settings['icon_color'] = '#0b5a45';
return $settings;
}, 10, 2 );

$settings is the sanitised array about to be stored; $raw is the unsanitised form submission. Return the array you want saved.

The storefront strip is built on --trust-* custom properties, --trust-seal (the ink/accent), --trust-paper, --trust-rule, --trust-icon-size, --trust-gap and --trust-radius, so you can re-theme it from your theme stylesheet without fighting markup. The icon colour you pick overrides --trust-seal inline. The accent falls back to your theme’s --wp--preset--color--primary where one is exposed. A prefers-color-scheme: dark variant and prefers-reduced-motion handling are built in and need no configuration.

Trust stores only two options in your own database: trust_settings (the configuration above) and trust_db_version (the migration marker). It creates no custom table. Deleting the plugin from the Plugins screen runs the uninstall routine, which deletes both options; WooCommerce data is never touched.