Skip to content

Commit

Permalink
Adding new blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariel Jolo committed Jan 28, 2025
1 parent aa8fe97 commit 87ab36b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions themes/osi/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,19 @@ function osi_register_block_template() {
}
add_action('init', 'osi_register_block_template');


function register_custom_blocks() {
// Register the block editor script
wp_register_script(
'custom-blocks-js',
get_template_directory_uri() . '/blocks/about-area/index.js', // Path to your block's JavaScript file
['wp-blocks', 'wp-element', 'wp-editor', 'wp-components'], // Dependencies
filemtime(get_template_directory() . '/blocks/about-area/index.js') // Versioning
);

// Register the block
register_block_type('custom/about-area', [
'editor_script' => 'custom-blocks-js',
]);
}
add_action('init', 'register_custom_blocks');

0 comments on commit 87ab36b

Please sign in to comment.