Plugin: improve bootstrapping #13634
Labels
Gutenberg Plugin
Issues or PRs related to Gutenberg Plugin management related efforts
[Type] Enhancement
A suggestion for improvement.
As work on #13569 progresses it would be good to look at the loading/bootstrapping of the Gutenberg plugin.
Currently all
add_filter()
andadd_action()
are "sprinkled around" in ~10 different files and executed as the PHP code loads. It would be better to add all hooks to one init/bootstrap function that is (typically) run atplugins_loaded
. There are few advantages:That would make it clearer/more structured/easier to see what's running where and when.
Would improve interoperability with other plugins. For example: plugins that want to disable Gutenberg (either for debugging or to let users get to Classic Editor) would only need to care about one hook when supporting multiple Gutenberg versions. Other plugins that want to interact only with a specific hook added by Gutenberg can still do that after the bootstrap action runs.
The "prior art" for this is in core. See https://github.com/WordPress/WordPress/blob/master/wp-includes/default-filters.php.
The text was updated successfully, but these errors were encountered: