Skip to content

Commit ba4f7d7

Browse files
committed
[docs] hooks: Clarify the execution order and priorities.
1 parent 86f5e25 commit ba4f7d7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/apis/core/hooks/index.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,15 @@ Support for Array notated callbacks was introduced in Moodle 4.4. If you are wri
291291

292292
:::
293293

294-
Hook callbacks are executed in the order of their priority from highest to lowest.
295-
Any guidelines for callback priority should be described in hook descriptions if necessary.
294+
### Hook Callback Execution Order
295+
296+
Hook callbacks are executed according to their priority, in **descending order** — from the **highest number** to the **lowest**.
297+
298+
- **Default priority:** `100`
299+
- **Higher numbers:** executed **earlier**
300+
- **Lower numbers (down to 0):** executed **later**
301+
302+
If a particular hook requires callbacks to run in a specific order, its documentation should include guidelines on what priorities to use.
296303

297304
:::caution
298305

0 commit comments

Comments
 (0)