WordPress / gutenberg.run

Gutenberg live branch preview provisioning service
https://playground.wordpress.net/gutenberg.html.
MIT License
25 stars 6 forks source link

Consider adding a block based theme automatically (tt1-blocks) #13

Open youknowriad opened 3 years ago

youknowriad commented 3 years ago

A lot of PRs these days are about Full Site Editing features requiring a block theme. Can we have tt1-blocks installed by default?

aduth commented 3 years ago

👋

There's some prior art to this with the time-remaining and disable-nux plugins installed by default as mu-plugins:

https://github.com/WordPress/gutenberg.run/blob/1e9211fc209ed76d81f80904c2e22b1abf70b3ed/images/gutenbergrun-site/Dockerfile#L29-L30

Those are pretty simple examples though, since they're single file plugins.

A zip might not be much more difficult if you'd extract it to a folder, then write a loader file like described in this page:

https://wordpress.org/support/article/must-use-plugins/

WordPress only looks for PHP files right inside the mu-plugins directory, and (unlike for normal plugins) not for files in subdirectories. You may want to create a proxy PHP loader file inside the mu-plugins directory:

e.g.

RUN curl -o my-plugin.zip http://example.com/plugin.zip && \
  unzip my-plugin.zip -d wp-content/mu-plugins/my-plugin && \
  echo "<?php require WPMU_PLUGIN_DIR . '/my-plugin/my-plugin.php';" && \
  rm my-plugin.zip