When to use?
In some cases, users might need to cover more areas/requests where the assignment items fall short. This is when Expressions can be used and passed to the CJT Assignment Panel.
What kind of Expression is it?
CJT currently supports only Regular Expression as PHP, except that you don’t need to write the Expression delimiters. The expression will be automatically wrapped by the forward-slashes /EXPRESSION/ delimiters.
Difference Between Expressions and URLs
Although URLs are a custom assignment, each URL can only cover a single WordPress request. Since each URL is internal and can only point to a single request, Expressions on the other hand can evaluate what URLs it has to apply the block with.
How it’s being evaluated
The CJT expressions parser accepts a list of expressions separated by a new line. In other words, each line would contain a full single expression.
Each expression (line) would be automatically wrapped by double forward slashes (as specified by PHP) and then evaluated to the current request URL. Once a single expression is valid and matching, the block is then added to the In-Load Blocks Queue (IBsQ). The blocks queue will process and then go onto the next block that has expressions and repeat.
Regular Expression References
Examples using Expressions
Matching all the site pages including frontend and backend:
Matching all Pages that start with ‘mypage’ including the ‘mypage’ page:
Matching any page that contains the word ‘test’:
Matching any page that ends up with the word ‘test’: