| 开发者 | webdevmattcrom |
|---|---|
| 更新时间 | 2026年1月20日 23:02 |
| PHP版本: | 5.8 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
#spp-trigger-{id} and now that link will open your modal on click, just like that!
You can also set a custom class name on a block:
spp-trigger-{id} (like on a column or section block)href="#spp-trigger-{id}" (handy in the Block Editor)spp-trigger-{id}-{width}.
🖼️Core Gallery Block Support
The Core Gallery block has a "lightbox" feature. But that feature does not support image navigation within the lightbox or captions or width management. Synced Pattern Popups lets you do all of that with your Core Gallery blocks. Simply choose the Gallery block (not the individual images within the Gallery block), and click on the link icon ("🔗"). There you'll see several options, including the Core lightbox feature, and now also "Open in Synced Pattern Popups".
🤖AI-powered TLDR (optional)
Generate AI summaries of the current page content on demand by adding a spp-trigger-tldr trigger. This feature requires the AI Experiments plugin and configured credentials (you’ll see guided setup in the TLDR tab).
💻Handy for Developer Features
Synced Pattern Popups is made to be user friendly, but it's also full of useful utilities for developers.
wp_execute_ability() in custom workflows). If the Abilities API isn’t available, the plugin simply skips this integration.class="spp-trigger-{ID}" or href="#spp-trigger-{ID}"wp_block posts) are reusable block layouts you can create and manage once, then reuse across your site. When you edit a synced pattern, any place it’s used is updated automatically.
This plugin surfaces them with a dedicated admin screen at Appearance → Synced Patterns, making it easy to:
sppopups folder to /wp-content/plugins/ directoryclass="spp-trigger-{id}" or href="#spp-trigger-{id}" to any elementYou can trigger a popup in two ways:
Method 1: Class Name (Recommended for custom HTML)
Add the class spp-trigger-{id} to any clickable element, where {id} is the numeric ID of your Synced Pattern.
Example:
<a href="#" class="spp-trigger-1359">Open Popup</a>
<button class="spp-trigger-1359">Click Me</button>
Method 2: Href Attribute (Perfect for Block Editor)
Set the href attribute to #spp-trigger-{id} on any link element. This is especially useful in the WordPress Block Editor where you can't easily add custom classes.
Example:
<a href="#spp-trigger-1359">Open Popup</a>
Go to WordPress Admin → Appearance → Synced Patterns. The ID column shows the pattern ID prominently. You can also click the "Copy Trigger" button in the Actions column to copy the complete trigger code.
Yes! You can have multiple different popups on the same page - just use different pattern IDs. Mix and match both trigger methods as needed.
Yes! Add a width suffix to your trigger: spp-trigger-{id}-{width} where width is in pixels (100-5000px).
Example:
<a href="#" class="spp-trigger-1359-800">Open 800px Modal</a>
The TLDR (Too Long; Didn't Read) feature generates AI-powered summaries of your page content. Simply add class="spp-trigger-tldr" or href="#spp-trigger-tldr" to any element, and when clicked, it will generate a concise summary of the current page.
Requirements:
Check these common issues:
spp-trigger-{id} (class) or #spp-trigger-{id} (href) where {id} is numericTroubleshooting steps:
Yes! The plugin works with most page builders. For dynamically loaded content (like Gravity Forms or AJAX-loaded sections), you may need to enable "Forced On" in the post meta box (Synced Pattern Popup Support) to ensure assets load.
Yes! The plugin uses WordPress transients for caching, which works with all major caching plugins. Cache is automatically invalidated when patterns are updated.
Yes! The plugin includes:
Yes! The plugin uses minimal CSS. You can override styles in your theme's CSS using the same class names. The modal uses these main classes:
.sppopups-modal - Main modal container.sppopups-overlay - Background overlay.sppopups-container - Content container.sppopups-content - Content areaWordPress 5.8 or higher. The plugin is tested up to WordPress 6.9.
PHP 7.4 or higher.
modalState object in modal.js.currentMaxWidth, lastActiveElement, loadedStyles) into the modalState object.gallery.js module for better code organization and conditional loadingmodalState object for improved documentation.maxWidth (100-5000px) within the modalState setter.load_plugin_textdomain() call.synced-pattern-popups) consistently matches across all plugin files.the_content filters before do_blocks() for proper block asset enqueuingstyle-blocks-*.css files for third-party block libraries