Using patterns (regex) to simplify echo function calls
Bricks 1.9.8 offers greater flexibility when it comes to echo function calls.
While you can still return an array with the exact function names, you can also return an array that contains specific regex checks. We identify those regex calls by the @ prefix.
If your function name matches any of those regex checks, it can be called through the echo tag.
Example: Allow calling any functions that start with brx_:
add_filter( 'bricks/code/echo_function_names', function($function_name) {
return [
'@^brx_', // Allow all functions that start with "brx_"
];
} );
Check function names against your own custom logic
Instead of returning an array, you can also perform any custom check against the function name itself or any other logic you want to run. The filter receives the function name ($function_name) as an argument to assist in making more dynamic decisions. Returning a boolean (true or false)
Example: Allow function execution based on function name prefix

