register_block()dynamically register block functions pluginsDescriptionvoidregister_blockstringnamemixedimplboolcacheablemixedcache_attrs
Use this to dynamically register
block function plugins.
Pass in the block function name, followed by the PHP
function's name that implements it.
&api.register.snippet;
cacheable and cache_attrs
can be omitted in most cases. See controlling cacheability of plugins' output
section on how to implement them properly.
register_block()
register_block('translate', 'do_translation');
?>
]]>
Where the template is:
See also
unregister_block()
and the
plugin block functions page.