[WordPress] 外掛分享: Synced Patterns for Themes

首頁外掛目錄 › Synced Patterns for Themes
10+
安裝啟用
尚無評分
215 天前
最後更新
問題解決
WordPress 6.6+ PHP 7.2+ v1.2.1 上架:2025-08-13

內容簡介

**外掛總結:** 這個外掛讓主題開發人員可以提供與同步模式相同行為的模式(可重複使用區塊),同時保留主題捆綁模式的優點。當主題模式標記為同步時,它會自動變為可重複使用區塊,並在修改時跨所有實例進行更新。 **問題與答案:** 1. 什麼是主題提供的同步模式? - 可將任何主題模式轉換為同步模式,只需添加簡單的元資料標誌。 2. 同步模式具有哪些特點? - 它允許同步模式更新跨整個網站的所有實例。 3. 該插件支持哪些功能? - 完全兼容 WordPress 區塊綁定,並可在模板和模板部件中使用同步模式。 4. 如何在模板中使用同步模式? - 可以使用模式區塊來引用模板中的同步模式或其他模式。 5. 開發人員如何將主題模式設定為同步? - 只需在模式文件的元資料標頭中添加 Synced: true。 6. 如何使用外掛提供的源碼? - 需要使用 Node 和 NPM 來安裝和運行開發工具,例如啟動開發環境、停止開發環境、運行單元測試以及建置生產資產。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.2.1) 或搜尋安裝
① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Synced Patterns for Themes」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin enables theme developers to ship patterns that behave as synced patterns (reusable blocks) while maintaining the benefits of theme-bundled patterns. When a theme pattern is marked as synced, it automatically becomes available as a reusable block that updates across all instances when modified. Theme-Provided Synced Patterns: Convert any theme pattern into a synced pattern by adding a simple metadata flag Automatic Synchronization: Updates to synced patterns propagate across all instances site-wide Block Bindings Support: Full compatibility with WordPress block bindings Template Integration: Use synced patterns in templates and template parts Seamless User Experience: Synced patterns appear naturally in the pattern inserter Usage For Theme Developers To make a theme pattern synced, add Synced: true to the pattern file’s metadata header: Using Synced Patterns in Templates Reference synced patterns in templates or other patterns using the pattern block:

Development

The plugin source is available on GitHub. Node & NPM are needed to install and run the development tools: npm run start – Start the development environment npm run stop – Stop the development environment npm run test – Run unit tests (requires running environment) npm run build – Build production assets See the source for more details.

延伸相關外掛


文章
Filter
Mastodon