Appearance
Expression Language
WP-Nexus includes a rich expression language powered by Symfony ExpressionLanguage. Expressions are used throughout the platform -- in widget text bindings, pipeline node configs, style visibility rules, and template nodes.
Template Syntax
Expressions are embedded in strings using two delimiter styles:
{ { expression }} -- Escaped text output
The expression result is converted to a string. This is safe for display in HTML text content.
Hello, `{ {row.name}}`! You have `{ {count(row.items)}}` items.<{ expression }> -- Raw HTML output
The expression result is passed through wp_kses_post(), which strips dangerous tags but allows safe HTML (paragraphs, links, bold, images, etc.).
<{content(row.post_content)}>Use <{ }> when you need to render HTML from a database field or WordPress content.
Standalone Expressions
In pipeline node configs and visibility rules, expressions are evaluated without delimiters:
row.status == 'active'
row.price > 100
user_can('edit_posts')Context Variables
Different contexts provide different variables:
Widget text bindings
| Variable | Description |
|---|---|
row | The current data context (repeater row, data source result). |
Pipeline node expressions
| Variable | Description |
|---|---|
row | The current row being processed (in per-row operations). |
input | The full input data from the upstream node. |
Pipeline config expressions
| Variable | Description |
|---|---|
input | The data flowing into the node from its upstream connection. |
Operators
Arithmetic
| Operator | Description | Example |
|---|---|---|
+ | Addition | row.price + row.tax |
- | Subtraction | row.total - row.discount |
* | Multiplication | row.price * row.quantity |
/ | Division | row.total / row.count |
% | Modulo | row.id % 2 |
** | Exponentiation | 2 ** 10 |
Comparison
| Operator | Description | Example |
|---|---|---|
== | Equal | row.status == 'active' |
!= | Not equal | row.status != 'draft' |
=== | Strict equal | row.count === 0 |
!== | Strict not equal | row.value !== null |
> | Greater than | row.price > 100 |
< | Less than | row.age < 18 |
>= | Greater or equal | row.score >= 80 |
<= | Less or equal | row.quantity <= 0 |
Logical
| Operator | Description | Example |
|---|---|---|
&& / and | Logical AND | row.active && row.visible |
|| / or | Logical OR | row.admin or row.editor |
! / not | Logical NOT | !row.deleted |
String
| Operator | Description | Example |
|---|---|---|
~ | Concatenation | row.first ~ ' ' ~ row.last |
Ternary and Null Handling
| Operator | Description | Example |
|---|---|---|
? : | Ternary | row.vip ? 'Gold' : 'Standard' |
?: | Elvis (falsy fallback) | row.nickname ?: row.name |
?? | Null-coalescing | row.phone ?? 'N/A' |
?. | Null-safe access | row?.address?.city |
Membership and Pattern
| Operator | Description | Example |
|---|---|---|
in | Array membership | row.role in ['admin', 'editor'] |
matches | Regex match | row.email matches '/@gmail\\.com$/' |
Field Access
Dot notation
row.name
row.address.city
row.items.0.titleBracket notation
row["field name"]
row["nested"]["field"]Null-safe access
row?.address?.cityReturns null instead of erroring if any intermediate value is null.
Functions
WP-Nexus provides 36 built-in functions organized into categories:
- String Functions --
upper,lower,trim,strlen,substr,replace,contains,split,join - Number Functions --
number_format,round,floor,ceil,abs,min,max - Date Functions --
date_format,now,today - Utility Functions --
default,count,json_encode,json_decode,random,slug,truncate,remap - WordPress Functions --
content,shortcode,wp_image - Auth Functions --
user_can,user_has_role,user_meta - Store Functions --
in_store,count_store - Relational Functions --
related
Examples
Display a formatted price
$`{ {number_format(row.price, 2)}}`Show a default value
`{ {default(row.bio, 'No bio provided')}}`Conditional badge text
`{ {row.stock > 0 ? 'In Stock' : 'Sold Out'}}`Format a date
`{ {date_format(row.created_at, 'F j, Y')}}`Truncate long text
`{ {truncate(row.description, 100, '...')}}`Check user permission
`{ {user_can('edit_posts') ? 'Editor' : 'Reader'}}`