EQL (Entity Query Language)
EQL is the structured query language WP-PFManagement uses for lists, saved views, and the record.query REST endpoint.
It is intentionally small — a couple of operators on field references — so it can be safely allowed in URLs without becoming a SQL injection vector. The parser lives in includes/Eql/.
Syntax
Three forms:
- Field operator value:
status:Lead,total>=200,email~=gmail. - AND / OR combinations:
status:Lead AND country:ES,status:Lead OR status:Customer. - Grouping with parens:
(status:Lead OR status:Customer) AND total>=100.
Operators
| Op | Meaning | Example |
|---|---|---|
: | exact match | status:Lead |
!= | not equal | status!=Customer |
~= | contains (case-insensitive) | email~=gmail |
~^ | starts with | name~^Jose |
~$ | ends with | email~$.es |
>=, <=, >, < | numeric / date comparison | total>=200, joined<2025-01-01 |
in [...] | value in list | status in [Lead, Customer] |
is null / is not null | null check | archived_at is null |
Free-text search
A bare word (no operator) does full-text match across all text and rich_text fields of the entity. martinez ES matches records where any text field contains both words.
Combining EQL with saved views
A saved view bundles: an EQL filter, an ordered list of visible columns, a sort, and an optional grouping. One click reapplies the bundle. Useful for shared workspace views ("Hot leads", "Open tickets older than 7 days").