Added base_url helper to blocks.

This commit is contained in:
2023-04-23 12:52:41 +03:00
parent 090978e8f8
commit 378038b244
3 changed files with 9 additions and 0 deletions
+5
View File
@@ -69,6 +69,11 @@ class Component_Builder {
$this->dist_path = __DIR__ . '/' . $this->module_path . '/../../' . $this->project_path . '/exports' . '/' . $args['platform'];
$this->register_default_handlebar_helpers();
$this->add_handlebar( 'base_url', function ( $context ) {
$path = join( '/', [ 'blocks', $this->block_project, $this->block_name, 'templates' ] );
return plugins_url( $path . '/', 'axeweb-blocks-library/axeweb-blocks-library.php' );
} );
}
function build(): void {