1.6 KiB
1.6 KiB
Velora Player: Fixes Applied
What I changed
- Updated block asset references in
blocks/block.json
- Replaced manual registered handles with file-based metadata references:
file:../assets/js/block-editor.jsfile:../assets/js/player.jsfile:../assets/css/player.cssfile:../assets/css/editor.css
- Switched block registration to metadata-based loading
- Updated
includes/class-plugin.phpto callregister_block_type_from_metadata(). - Removed the old manual asset registration method so block loading no longer depends on custom handle registration order.
- Added WordPress asset metadata files
- Added
assets/js/block-editor.asset.phpso WordPress knows the Gutenberg editor script dependencies. - Added
assets/js/player.asset.phpfor the frontend player script metadata.
- Added explicit
modern-darktheme class
- Added
.map-theme-modern-darkand.map-theme-modern-dark::beforerules inassets/css/player.css. - The theme is no longer only implied by the base
.map-playerstyles.
- Ensured shortcode/dynamic rendering still loads frontend assets
- Added block asset enqueue logic in
includes/class-renderer.php. - When the player is rendered on the frontend, it now pulls the registered style/script handles from the registered block type and enqueues them.
Result
- Gutenberg block loading is now metadata-driven and more reliable.
- The block no longer relies on manual script/style handle registration order.
- The
modern-darktheme now has a real theme class. - Shortcode rendering still gets the same frontend assets as the block.