跳到内容

Vector Expressions

v1.0.2

vectorarrow · 2026年3月17日 上架

Embed dynamic expressions in the Gutenberg block editor to personalize content and control block visibility.

正在使用
10 以下
评分
暂无
累计下载
513
最近更新
2026年3月17日
需要 WordPress 6.2+已测试到 6.9.12PHP 8.1+

贡献者

截图

Expression editor with live previews — edit expressions in the sidebar and see resolved values in real time.
Expression editor with live previews — edit expressions in the sidebar and see resolved values in real time.
Autocomplete menu — type {{ to browse data roots and insert expressions without memorizing syntax.
Autocomplete menu — type {{ to browse data roots and insert expressions without memorizing syntax.
Suggestion browser — browse all available data roots, properties, and filters organized by category.
Suggestion browser — browse all available data roots, properties, and filters organized by category.
Visibility and dynamic class controls — show or hide any block based on conditions and inject CSS classes powered by expressions.
Visibility and dynamic class controls — show or hide any block based on conditions and inject CSS classes powered by expressions.

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.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums