Plugin Directory

Changeset 3360760


Ignore:
Timestamp:
09/12/2025 08:29:48 PM (7 months ago)
Author:
mrboydwp
Message:

Update to version 1.2.3

Location:
bcodecraft-blocks
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bcodecraft-blocks/tags/1.2.3/includes/class-snippy-blocks-editor.php

    r3360754 r3360760  
    1616
    1717    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';
    2020       
    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', [
    2324                'render_callback' => [$this, 'renderBlockCallback'],
    2425            ]);
    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 {
    2735            register_block_type('bccb-blocks/snippet', [
    2836                'render_callback' => [$this, 'renderBlockCallback'],
  • bcodecraft-blocks/trunk/includes/class-snippy-blocks-editor.php

    r3360754 r3360760  
    1616
    1717    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';
    2020       
    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', [
    2324                'render_callback' => [$this, 'renderBlockCallback'],
    2425            ]);
    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 {
    2735            register_block_type('bccb-blocks/snippet', [
    2836                'render_callback' => [$this, 'renderBlockCallback'],
Note: See TracChangeset for help on using the changeset viewer.