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/3: block variation loading #898

Merged

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

... loaded from includes/core/classes/blocks.

This design-decision was made in a private chat between @mauteri and me.

Closes #

How to test the Change

Changelog Entry

Added - Generalized the loading of block-variations

Credits

Props @carstingaxion, @mauteri

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

This comment was marked as outdated.

@carstingaxion carstingaxion marked this pull request as ready for review September 25, 2024 12:03
@carstingaxion carstingaxion changed the title Prepare for new block variations 3/x: block variation loading Prepare for new block variations 3/3: block variation loading Oct 5, 2024
@mauteri mauteri changed the base branch from main to develop October 10, 2024 12:58
@carstingaxion

This comment was marked as resolved.

@mauteri

This comment was marked as resolved.

@carstingaxion

This comment was marked as resolved.

@carstingaxion

This comment was marked as off-topic.

Copy link

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.

@mauteri mauteri merged commit 6478e00 into GatherPress:develop Oct 17, 2024
16 checks passed
@carstingaxion
Copy link
Collaborator Author

Woooow! That was super fast again, @mauteri
Thank you!

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.

2 participants