register_block
void register_block
string name
string impl
Use this to dynamically register block functions plugins.
Pass in the block function name, followed by the PHP
function name that implements it.
register_block
register_block("translate", "do_translation");
function do_translation ($params, $content, &$smarty) {
if ($content) {
$lang = $params['lang'];
// do some translation with $content
echo $translation;
}
}
?>
{* template *}
{translate lang="br"}
Hello, world!
{/translate}
]]>