Create hooks to load plugins and for when the theme is ready. #2479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.