Skip to main content

Bricks Echo Function Names

PropertyValue
descriptionAllowlist PHP functions for Bricks dynamic data echo tags.
tagslib, php, wp, bricks
rating

Overview

Allow specific PHP functions to be called from Bricks {echo:...} dynamic data.

Use the Static variant when you want to allowlist exact function names. Use the Regex variant when you want to allow a naming convention, such as every function that starts with mac_.

Bricks must still have code execution enabled for the relevant user role. Keep the allowlist narrow unless the site intentionally treats a function prefix as trusted.

Variants

<?php
/**
* Bricks Echo Function Names
*
* https://academy.bricksbuilder.io/article/filter-bricks-code-echo_function_names/
*
* @return string[]
*/
add_filter( 'bricks/code/echo_function_names', function (): array {
return [
'mac_my_function_1',
'mac_my_function_2',
];
} );