Skip to content

Commit 87ab36b

Browse files
author
Ariel Jolo
committed
Adding new blocks
1 parent aa8fe97 commit 87ab36b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

themes/osi/functions.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,3 +497,19 @@ function osi_register_block_template() {
497497
}
498498
add_action('init', 'osi_register_block_template');
499499

500+
501+
function register_custom_blocks() {
502+
// Register the block editor script
503+
wp_register_script(
504+
'custom-blocks-js',
505+
get_template_directory_uri() . '/blocks/about-area/index.js', // Path to your block's JavaScript file
506+
['wp-blocks', 'wp-element', 'wp-editor', 'wp-components'], // Dependencies
507+
filemtime(get_template_directory() . '/blocks/about-area/index.js') // Versioning
508+
);
509+
510+
// Register the block
511+
register_block_type('custom/about-area', [
512+
'editor_script' => 'custom-blocks-js',
513+
]);
514+
}
515+
add_action('init', 'register_custom_blocks');

0 commit comments

Comments
 (0)