mirror of
https://gh.wpcy.net/https://github.com/michelve/software-license-manager.git
synced 2026-05-27 08:10:38 +08:00
feat: Add custom block category "SLM Plus" and improve shortcode blocks - Registered a new block category "SLM Plus" for better organization. - Updated "Forgot License" and "List Licenses" blocks to assign them to the custom category. - Improved block editor previews for both blocks: - "Forgot License" block displays a preview with a form placeholder. - "List Licenses" block displays a preview with a sample list of licenses. - Fixed issues with blocks appearing under "Uncategorized" by ensuring proper category registration. - Ensured unique naming in block scripts to avoid conflicts. - Added clear styles for block previews and frontend rendering in `slm-blocks.css`. - Verified shortcode functionality for rendering licenses dynamically.
25 lines
532 B
PHP
25 lines
532 B
PHP
<?php
|
|
|
|
// If this file is called directly, abort.
|
|
if (!defined('WPINC')) {
|
|
die();
|
|
}
|
|
|
|
// Register block editor assets.
|
|
add_action('enqueue_block_editor_assets', function () {
|
|
wp_enqueue_script(
|
|
'slm-blocks-js',
|
|
SLM_ASSETS_URL . 'js/slm-blocks.js',
|
|
['wp-blocks', 'wp-editor', 'wp-element', 'wp-i18n'], // Dependencies.
|
|
SLM_VERSION,
|
|
true
|
|
);
|
|
|
|
wp_enqueue_style(
|
|
'slm-blocks-style',
|
|
SLM_ASSETS_URL . 'css/slm-blocks.css',
|
|
[],
|
|
SLM_VERSION
|
|
);
|
|
});
|
|
|