Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for new block variations 3/x: block variation loading #898

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

carstingaxion
Copy link
Collaborator

@carstingaxion carstingaxion commented Sep 21, 2024

Preparation to bring some block variations from the gatherpress-block-playground into the plugin as part of #626.

While current blocks can rely on register_block_type() to get everything in place, block variations need more manual attention.

Description of the Change

With this PR, I try to outline a possible way to load all variations the same way.

Because most of the variations need some extra php to work, I went with a singleton, that gets automatically copied from /src to /build and lives in the folder of the variation. For this reason the autoloader doesn’t know about the classes and that’s why I required them manually.

Could this be done nicer @mauteri ??

Closes #

How to test the Change

Changelog Entry

Added - Generalized the loading of block-variations

Credits

Props @carstingaxion

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@carstingaxion
Copy link
Collaborator Author

carstingaxion commented Sep 21, 2024

He @mauteri could you please take a look at this idea of how to load the variations?

I based this branch on the work of #888, that’s why there are so many commits, but if possible, only focus on the last three four commits. And don’t forget about the PR description ;)

thanks.

@carstingaxion carstingaxion marked this pull request as ready for review September 25, 2024 12:03
Copy link

github-actions bot commented Oct 1, 2024

Preview changes with Playground

You can preview the recent changes for PR#898 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant