Automattic / block-experiments

A monorepo of Block Experiments
127 stars 17 forks source link

Motion Background: Fix function redeclaration error #332

Closed ajlende closed 11 months ago

ajlende commented 11 months ago

Description

In WordPress 6.3, the enqueue_block_assets was getting called twice causing the function inside to be redeclared.

This PR fixes the issue by moving the script enqueues into the render_callback. The code is also refactored to be a bit more like how Jetpack blocks are structured.

Testing Instructions

  1. Open the site editor and post editor.
  2. See that there are no errors.
ajlende commented 11 months ago

Closing in favor of #333.