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

Plugin: improve bootstrapping #13634

Closed
azaozz opened this issue Feb 1, 2019 · 1 comment
Closed

Plugin: improve bootstrapping #13634

azaozz opened this issue Feb 1, 2019 · 1 comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Enhancement A suggestion for improvement.

Comments

@azaozz
Copy link
Contributor

azaozz commented Feb 1, 2019

As work on #13569 progresses it would be good to look at the loading/bootstrapping of the Gutenberg plugin.

Currently all add_filter() and add_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 at plugins_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.

@azaozz azaozz added [Type] Enhancement A suggestion for improvement. Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts labels Feb 1, 2019
@paaljoachim
Copy link
Contributor

Is this issue still relevant? Should it be closed?

@mtias mtias closed this as completed Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants