Changeset 3360760
- Timestamp:
- 09/12/2025 08:29:48 PM (7 months ago)
- Location:
- bcodecraft-blocks
- Files:
-
- 2 edited
-
tags/1.2.3/includes/class-snippy-blocks-editor.php (modified) (1 diff)
-
trunk/includes/class-snippy-blocks-editor.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bcodecraft-blocks/tags/1.2.3/includes/class-snippy-blocks-editor.php
r3360754 r3360760 16 16 17 17 public function registerBlock() { 18 // WordPress 6.0+ compatible block registration 19 $block_json_ file = SNIPPY_BLOCKS_PLUGIN_DIR . 'block.json';18 // WordPress 6.0+ compatible block registration with explicit namespace 19 $block_json_path = SNIPPY_BLOCKS_PLUGIN_DIR . 'build'; 20 20 21 if (file_exists($block_json_file)) { 22 register_block_type($block_json_file, [ 21 // First check if build version exists (production) 22 if (file_exists($block_json_path . '/block.json')) { 23 register_block_type($block_json_path . '/block.json', [ 23 24 'render_callback' => [$this, 'renderBlockCallback'], 24 25 ]); 25 } else { 26 // Manual registration as fallback 26 } 27 // Fallback to source version (development) 28 else if (file_exists(SNIPPY_BLOCKS_PLUGIN_DIR . 'src/block.json')) { 29 register_block_type(SNIPPY_BLOCKS_PLUGIN_DIR . 'src/block.json', [ 30 'render_callback' => [$this, 'renderBlockCallback'], 31 ]); 32 } 33 // Manual registration as fallback (should not happen if files exist) 34 else { 27 35 register_block_type('bccb-blocks/snippet', [ 28 36 'render_callback' => [$this, 'renderBlockCallback'], -
bcodecraft-blocks/trunk/includes/class-snippy-blocks-editor.php
r3360754 r3360760 16 16 17 17 public function registerBlock() { 18 // WordPress 6.0+ compatible block registration 19 $block_json_ file = SNIPPY_BLOCKS_PLUGIN_DIR . 'block.json';18 // WordPress 6.0+ compatible block registration with explicit namespace 19 $block_json_path = SNIPPY_BLOCKS_PLUGIN_DIR . 'build'; 20 20 21 if (file_exists($block_json_file)) { 22 register_block_type($block_json_file, [ 21 // First check if build version exists (production) 22 if (file_exists($block_json_path . '/block.json')) { 23 register_block_type($block_json_path . '/block.json', [ 23 24 'render_callback' => [$this, 'renderBlockCallback'], 24 25 ]); 25 } else { 26 // Manual registration as fallback 26 } 27 // Fallback to source version (development) 28 else if (file_exists(SNIPPY_BLOCKS_PLUGIN_DIR . 'src/block.json')) { 29 register_block_type(SNIPPY_BLOCKS_PLUGIN_DIR . 'src/block.json', [ 30 'render_callback' => [$this, 'renderBlockCallback'], 31 ]); 32 } 33 // Manual registration as fallback (should not happen if files exist) 34 else { 27 35 register_block_type('bccb-blocks/snippet', [ 28 36 'render_callback' => [$this, 'renderBlockCallback'],
Note: See TracChangeset
for help on using the changeset viewer.