Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance: pass block data to enqueue method
Ref Log1x#144 and Log1x#143 I have played about locally on this and seems we can simply pass the `$block` array to the `enqueue` method which gives access to `$block['data']['my_field_name']`. This allowed me to conditionally enqueue assets depending on field values. This PR needs more work like adding the argument to `Block::enqueue($data = [])` but I opened the PR just to get the ball rolling on this. It would result in a breaking change since the signature has changed. @Log1x - anything to add to this? Not as nice as `get_field` in the method but hey it works.
- Loading branch information