Changeset 3360726
- Timestamp:
- 09/12/2025 06:35:18 PM (7 months ago)
- Location:
- bcodecraft-blocks/trunk
- Files:
-
- 17 added
- 3 edited
-
assets (added)
-
assets/css (added)
-
assets/css/admin.css (added)
-
assets/css/tinymce-modal.css (added)
-
assets/icons (added)
-
assets/icons/README.md (added)
-
assets/icons/bccb-icon.png (added)
-
assets/js (added)
-
assets/js/admin.js (added)
-
assets/js/tinymce-plugin.js (added)
-
build (added)
-
build/block.json (added)
-
build/index.asset.php (added)
-
build/index.js (added)
-
build/render.php (added)
-
build/style-index-rtl.css (added)
-
build/style-index.css (added)
-
includes/class-snippy-blocks-editor.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
snippy-blocks.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bcodecraft-blocks/trunk/includes/class-snippy-blocks-editor.php
r3360711 r3360726 16 16 17 17 public function registerBlock() { 18 // WordPress 6.0+ compatible block registration 19 // Register block type with proper namespace handling 18 // WordPress 6.0+ compatible block registration with explicit namespace 20 19 $block_json_path = SNIPPY_BLOCKS_PLUGIN_DIR . 'build'; 21 20 21 // First check if build version exists (production) 22 22 if (file_exists($block_json_path . '/block.json')) { 23 // Production: use built block.json 24 register_block_type($block_json_path, [ 23 register_block_type($block_json_path . '/block.json', [ 25 24 'render_callback' => [$this, 'renderBlockCallback'], 26 25 ]); 27 } else { 28 // Development: use source block.json 29 register_block_type(SNIPPY_BLOCKS_PLUGIN_DIR . 'src', [ 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 30 'render_callback' => [$this, 'renderBlockCallback'], 31 ]); 32 } 33 // Manual registration as fallback (should not happen if files exist) 34 else { 35 register_block_type('bccb-blocks/snippet', [ 36 'render_callback' => [$this, 'renderBlockCallback'], 37 'attributes' => [ 38 'snippetId' => [ 39 'type' => 'number', 40 'default' => 0 41 ], 42 'snippetTitle' => [ 43 'type' => 'string', 44 'default' => '' 45 ], 46 'snippetContent' => [ 47 'type' => 'string', 48 'default' => '' 49 ] 50 ] 31 51 ]); 32 52 } -
bcodecraft-blocks/trunk/readme.txt
r3360709 r3360726 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 1.2. 28 Stable tag: 1.2.3 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
bcodecraft-blocks/trunk/snippy-blocks.php
r3360709 r3360726 3 3 * Plugin Name: bcodecraft Blocks 4 4 * Description: A modern WordPress plugin for managing and reusing content snippets with seamless Block Editor integration. 5 * Version: 1.2. 25 * Version: 1.2.3 6 6 * Author: bcodecraft 7 7 * License: GPL v2 or later … … 17 17 } 18 18 19 define('SNIPPY_BLOCKS_VERSION', '1.2. 2');19 define('SNIPPY_BLOCKS_VERSION', '1.2.3'); 20 20 define('SNIPPY_BLOCKS_PLUGIN_FILE', __FILE__); 21 21 define('SNIPPY_BLOCKS_PLUGIN_DIR', plugin_dir_path(__FILE__));
Note: See TracChangeset
for help on using the changeset viewer.