You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apis/core/hooks/index.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -296,9 +296,10 @@ Any guidelines for callback priority should be described in hook descriptions if
296
296
297
297
:::caution
298
298
299
-
Callbacks _are executed during system installation and all upgrades_, the callback
300
-
methods must verify the plugin is in correct state. Often the easiest way is to
301
-
use function during_initial_install() or version string from the plugin configuration.
299
+
Unlike lib.php based plugin callbacks, certain hooks _are dispatched during system installation and upgrade_ (for example `before_http_headers`). Callback
300
+
methods for such hooks must take extra care to ensure the plugin is properly initialised, as (among other things) on install _the site's database is not initialised_.
301
+
The function during_initial_install() or version string from the plugin configuration may be used to conditionally make DB queries or use API functions in such cases.
302
+
Failure to do so may render the web install/upgrade page unusable.
0 commit comments