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

feat: add ssrbaz block example + block autoloader #5

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

chrisbellboy
Copy link
Contributor

I recently needed to create some SSR blocks for a project and so just creating this PR in case it's also useful for the base repo.

Changes proposed in this Pull Request

  • Add server-side rendered block example: ssrbaz.
  • Add block autoloader to automatically register all blocks inside build/* - eliminates the need for manual register_block_type entries for each block. It also checks for the existence of SSR callbacks, specifically bpd_blocks_render_block_* and includes them via the $args if they are found.
  • Add autoloader for PHP files inside individual block folders in src - allows for SSR blocks to have a PHP file with the render_callback alongside the other block files.

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