velora-player/IMPLEMENTATION-CHANGES.md
2026-03-23 16:55:03 +01:00

1.6 KiB

Velora Player: Fixes Applied

What I changed

  1. Updated block asset references in blocks/block.json
  • Replaced manual registered handles with file-based metadata references:
    • file:../assets/js/block-editor.js
    • file:../assets/js/player.js
    • file:../assets/css/player.css
    • file:../assets/css/editor.css
  1. Switched block registration to metadata-based loading
  • Updated includes/class-plugin.php to call register_block_type_from_metadata().
  • Removed the old manual asset registration method so block loading no longer depends on custom handle registration order.
  1. Added WordPress asset metadata files
  • Added assets/js/block-editor.asset.php so WordPress knows the Gutenberg editor script dependencies.
  • Added assets/js/player.asset.php for the frontend player script metadata.
  1. Added explicit modern-dark theme class
  • Added .map-theme-modern-dark and .map-theme-modern-dark::before rules in assets/css/player.css.
  • The theme is no longer only implied by the base .map-player styles.
  1. 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-dark theme now has a real theme class.
  • Shortcode rendering still gets the same frontend assets as the block.