
內容簡介
Vector Expressions 外掛允許使用者在 Gutenberg 編輯器中輕鬆插入動態內容,透過簡單的模板語法來顯示即時數據,提升網站的個人化和互動性。
【主要功能】
• 動態內容插入:使用簡單模板語法插入即時數據
• 個人化顯示:根據訪客身份顯示自訂訊息
• 可見性控制:根據條件顯示或隱藏區塊
• 動態 CSS 類別:根據即時數據注入 CSS 類別
• 內建過濾器:提供 20 多種可鏈接的過濾器
• 編輯器自動補全:智能自動補全功能提升編輯效率
外掛標籤
開發者團隊
原文外掛簡介
Features
Dynamic Content — Insert live data into any block using a simple template syntax: {{ post.title }}, {{ user.name }}, {{ site.name }}. No shortcodes, no PHP templates, no code.
Personalization — Greet visitors by name, show role-specific content, or display custom messages based on login status. Expressions are evaluated server-side on every page load.
Visibility Control — Show or hide any Gutenberg block based on conditions. Display content only for logged-in users, specific roles, or specific post states — all configured from the block sidebar.
Dynamic CSS Classes — Inject CSS classes into any block based on live data. Style blocks differently for administrators vs. guests, published vs. draft posts, and more.
20+ Built-in Filters — Transform values with chainable pipes: upper, lower, truncate, date, default, match, replace, kebab, and more. Chain them: {{ post.title | upper | truncate 20 }}.
Custom Fields — Access any post or user meta with post.meta.my_field or user.meta.my_field. Sensitive keys are blocked by default.
Full Expression Language — Arithmetic, comparison, ternary, logical operators, string interpolation, and bracket access. All evaluated server-side with zero frontend JavaScript.
In-Editor Autocomplete — Typing {{ triggers smart autocomplete with categorized suggestions, icons, and live previews.
Extensible — Register custom data roots, custom filters, and custom autocomplete suggestions via WordPress hooks and JavaScript filters.
For complete syntax reference, filter documentation, and developer guides, visit the full documentation.
How It Works
Add an expression to any block’s text content by typing {{ and selecting your expression from the autocomplete menu. The plugin will automatically format it as an expression chip.
{{ post.title }}
{{ user.name | default "Guest" }}
{{ post.date | date "F j, Y" }}
{{ user.is_logged_in ? "Welcome back!" : "Hello, visitor!" }}
Expressions are rendered as interactive chips in the editor and resolved server-side on every page render. No JavaScript runs on the frontend.
For the full syntax guide, data roots, and filter reference, see the documentation.
Source Code
The full, uncompressed source code is publicly available on GitHub.
