Skip to content
PHP Actions

lzb/handlebars/object

Action to extend Handlebars functionality.

Attributes

NameTypeDescription
$handlebarsObjectHandlebars object

Usage

PHP
function my_custom_lazyblock_handlebars_helper ( $handlebars ) {
  // date_i18n.
  // {{my_test_helper 'test value'}}.
  $handlebars->registerHelper( 'my_test_helper', function( $val ) {
    return '<p>My test helper: ' . $val . '</p>';
  } );
}
add_action( 'lzb/handlebars/object', 'my_custom_lazyblock_handlebars_helper' );

Was this article helpful?