Vector Expressions

Vector 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.

  1. Upload the plugin files to the /wp-content/plugins/vector-expressions directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress.
  3. Open the Block Editor and click the Vector ({{ braces) icon in the sidebar to access the Vector tab.

سوالات متداول

Does this work with any block?

Yes. Expressions can be inserted into any block that uses Gutenberg’s standard RichText component — including paragraphs, headings, buttons, lists, and third-party blocks. Editor previews resolve automatically for these blocks. Blocks that don’t support previews are still processed and rendered on the frontend. A small number of code-oriented blocks (Code, Preformatted, HTML, Shortcode, Classic Editor) are excluded.

Is the content evaluated on the server or the client?

All expressions are evaluated server-side on every block render. There is no JavaScript on the frontend, so content is resolved before it reaches the visitor’s browser.

Can I use custom post meta or user meta?

Yes. Use post.meta.my_field or user.meta.my_field to access any registered meta field. Sensitive meta keys (containing “password”, “token”, “secret”, etc.) are blocked by default.

Is this compatible with caching plugins?

Expressions that depend on the current user (e.g., user.name, user.is_logged_in) require per-user or no-cache handling. Post-only expressions (e.g., post.title) are fully cache-safe.

Can I extend it with my own data or filters?

Yes. Use PHP filters to register custom data roots and custom filter functions. Use JavaScript filters to add autocomplete suggestions in the editor. See the developer documentation for details.

×
نظری برای این آیتم موجود نیست.
0 0 رای ها
امتیازدهی
اشتراک در
اطلاع از
0 نظرات
قدیمی‌ترین
تازه‌ترین بیشترین رأی
بازخورد (Feedback) های اینلاین
مشاهده همه دیدگاه ها
نسخه حجم فایل SHA256 تغییرات دانلود
1.0.2 118 کیلوبایت -
دانلود
×
بدون امتیاز

قیمت:

رایگان

نگارش

1.0.2

آخرین انتشار

17 اردیبهشت 1405

آخرین بروزرسانی

1 ماه پیش

نصب های فعال

-

نگارش وردپرس

وردپرس 6.2+

تست شده از نسخه

وردپرس 6.9.4

نگارش PHP

PHP 8.1+

نسخه ها

1 نسخه