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

Create hooks to load plugins and for when the theme is ready. #2479

Merged
merged 1 commit into from
May 20, 2024

Conversation

corsacca
Copy link
Member

@corsacca corsacca commented May 17, 2024

Introducing 2 new actions.

disciple_tools_load_plugins

This is where plugins are to be loaded.
This action is called after the theme is loaded so we can use classes and functions from the theme (but not the DT_Posts API).

disciple_tools_loaded

This action is called after the theme and plugins have loaded.
It is now safe to call the DT_Posts API. We will be moving the DT_Posts API to only be available after all the theme and all the plugins have loaded. This is to avoid accidentally using the function too early and getting errors during runtime or only getting a partial return of data.

Example: using DT_Posts::get_post_field_settings() and only getting the theme fields and not any from the plugins.

@corsacca corsacca merged commit cafcb78 into develop May 20, 2024
4 checks passed
@corsacca corsacca deleted the loading-order-hooks branch May 20, 2024 15:30
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