Zum Inhalt springen

Configuration

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Peek is configured from one screen: the Peek menu in wp-admin (capability manage_woocommerce). It opens with sensible defaults, so you only change what you need. The controls fall into three groups, the trigger button, the modal chrome, and the modal content, all saved into one peek_settings option.

The master switch. When off, Peek loads nothing on the storefront, no button, no script, no styles. Turn it on to render the trigger in your product loops.

The text shown on the trigger, for example Quick view or Peek inside. For the icon-only style this label is still used as the accessible name, so screen-reader users always hear a meaningful action.

  • Text, a plain text button. Safest for most themes and the clearest call to action.
  • Icon, an icon only, for compact image-led grids. The label above becomes the accessible name.
  • Icon + text, both, the most explicit option.
  • Below the product card, the trigger sits under each card. Card height stays predictable across the grid.
  • On the product image (hover / focus), the trigger overlays the thumbnail and appears on hover and on keyboard focus, keeping dense grids clean until the shopper reaches for it.

Choose the loops Peek attaches to:

  • Shop and product archives only, the shop page plus category, tag and taxonomy archives.
  • Also single-product related / up-sell loops, additionally render the trigger in the related-products and up-sell sections on single product pages.

Peek never adds a trigger to the single product template itself, that page is already the full product.

These controls govern the dialog frame around the product fragment:

  • Modal heading, show or hide the product title as the dialog heading.
  • Close button, show or hide the close control, and set its accessible label.
  • Backdrop-click close, allow closing by clicking outside the dialog.
  • Loading text and error text, copy shown while the AJAX fragment loads and if it fails.
  • View-product link text, label for the link to the full product page.
  • SKU label, the prefix shown before the SKU in the modal.

Pick which parts of the product render in the AJAX fragment. Each is an independent toggle, and empty fields hide themselves automatically:

  • Featured image
  • Gallery, with a configurable thumbnail count (0-12)
  • Title
  • SKU
  • Price
  • Stock status
  • Short description
  • Add-to-cart, including the variation form on variable products
  • View-product link

Every control carries a ? affordance built on the native Popover API, wired to its field with aria-describedby. Without JavaScript the same text stays available as the control’s title, so the help never disappears for keyboard or screen-reader users.

The whole screen saves to a single peek_settings option (an array) via the Settings API. The save capability is manage_woocommerce, so shop managers, not only administrators, can edit it. Empty text fields are not stored blank: on save each one falls back to its packaged default (for example clearing Button label restores Quick view), and gallery_limit is clamped to 0-12. Changes take effect on the next page load; label and copy updates need no permalink flush or cache rebuild.

A few behaviours are deliberately not settings:

  • The trigger is never added to the single product template itself, only to shop/archive loops and, optionally, the related/up-sell loops on a single product page.
  • The modal can always be closed with the Escape key, regardless of the close-button and backdrop-close toggles.
  • The AJAX endpoint only serves published products (or ones the current user can edit), so a draft or private product cannot be previewed through a guessed ID.

Peek does not load templates from your theme, the loop button, modal shell and product fragment render from the plugin’s own templates/ directory and are not overridable by copying files into yourtheme/peek/. To change the modal output, use the action hooks below or restyle with the --peek-* CSS custom properties (see Using quick view).

Peek fires action hooks at fixed points in its templates and one filter on save. None require the engine internals; add them from your theme functions.php or a small plugin.

// Add a row to the modal summary, just before the add-to-cart form.
add_action( 'peek_quick_view_before_cart', function ( WC_Product $product, array $settings ): void {
if ( $product->is_on_sale() ) {
echo '<p class="my-sale-note">' . esc_html__( 'On sale now', 'my-theme' ) . '</p>';
}
}, 10, 2 );
HookTypeFiresPasses
peek_quick_view_modal_dialog_startactiontop of the dialog, before the status line,
peek_quick_view_before_cartactionin the summary, before the add-to-cart form$product, $settings
peek_quick_view_after_cartactionin the summary, after the add-to-cart form$product, $settings
peek_quick_view_content_endactionend of the summary column$product, $settings
peek_admin_settings_after_general_tableactionsettings page, after the chrome table$settings
peek_admin_settings_after_content_tableactionsettings page, after the content table$settings
peek_sanitize_settingsfilteron save, after sanitisation$sanitized, $raw, return the array

Peek registers no boot-signal actions for general use, these template and save hooks are the supported extension points.

Everything lives in your own database, Peek contacts no external service. All settings are in the single peek_settings option; there is no custom table. Deleting the plugin from wp-admin runs uninstall.php, which removes peek_settings and peek_db_version. WooCommerce data is never touched.