added additional plugins
This commit is contained in:
parent
c85895d306
commit
00e60ec1b7
132 changed files with 27514 additions and 0 deletions
33
native/wordpress/maple-code-blocks/includes/basic-block.php
Normal file
33
native/wordpress/maple-code-blocks/includes/basic-block.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* Ultra Simple Block Registration - PHP Only
|
||||
* This ensures the block is registered even if JavaScript fails
|
||||
*/
|
||||
|
||||
add_action('init', function() {
|
||||
if (!function_exists('register_block_type')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Register a basic block with PHP only
|
||||
register_block_type('maple-code-blocks/basic', array(
|
||||
'title' => 'Maple Code Block (Basic)',
|
||||
'description' => 'Display code from repositories',
|
||||
'category' => 'widgets',
|
||||
'icon' => 'editor-code',
|
||||
'keywords' => array('maple', 'code', 'github'),
|
||||
'attributes' => array(
|
||||
'repository' => array(
|
||||
'type' => 'string',
|
||||
'default' => ''
|
||||
)
|
||||
),
|
||||
'render_callback' => function($attributes) {
|
||||
$repo = isset($attributes['repository']) ? $attributes['repository'] : '';
|
||||
if (empty($repo)) {
|
||||
return '<p>Enter a repository in block settings</p>';
|
||||
}
|
||||
return do_shortcode('[maple_code_block repo="' . esc_attr($repo) . '"]');
|
||||
}
|
||||
));
|
||||
}, 100); // Very late priority to ensure everything is loaded
|
||||
Loading…
Add table
Add a link
Reference in a new issue