Skip to content

Commit

Permalink
Adds warnings and links to hook lists
Browse files Browse the repository at this point in the history
  • Loading branch information
amandafrench committed May 13, 2024
1 parent cf55018 commit 54f9231
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dev/documentation/3.3/en/utilities-hooks.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
book: dev-documentation
version: 3.3
showPageTOC: true
title: Hooks - Technical Documentation - OJS|OMP|OPS 3.3
---

Expand Down Expand Up @@ -102,7 +103,7 @@ Hooks are most commonly used in generic plugins. Calling hooks from other types

The following is a list of the most common hooks that can be used.

> This is an incomplete list. Search the application code for `HookRegistry::call` to get a complete list.
> This is an incomplete list. Search the [application code](https://github.com/pkp/ojs/tree/stable-3_3_0) for `HookRegistry::call` to get a complete list of hooks available in OJS 3.3.
{:.warning}

### Request, Routing and Templating
Expand Down
3 changes: 2 additions & 1 deletion dev/documentation/en/utilities-hooks.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
book: dev-documentation
version: 3.4
showPageTOC: true
title: Hooks - Technical Documentation - OJS|OMP|OPS
---

Expand Down Expand Up @@ -106,7 +107,7 @@ Hooks are most commonly used in generic plugins. Calling hooks from other types

## Common Hooks

The following is a list of the most common hooks that can be used. Find all of the hooks in the application by searching for `Hook::call` in the code.
> This is an incomplete list. Search the [application code](https://github.com/pkp/ojs) for `HookRegistry::call` to get a complete list of hooks available in OJS 3.4.
{:.warning}

### Request, Routing and Templating
Expand Down
6 changes: 6 additions & 0 deletions ojs-2-technical-reference/en/hook_list.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Hook List

> This hook list is out of date. Some hooks may not work with newer versions of OJS. Please consult [v3.3 Common Hooks](/dev/documentation/3.3/en/utilities-hooks#common-hooks) and [v3.4 Common Hooks](/dev/documentation/en/utilities-hooks#common-hooks) for currently supported hooks.
{:.warning}

The following list describes all the hooks built into OJS as of release 2.1. Ampersands before variable names (e.g. ``&$sourceFile``) indicate that the parameter has been passed to the hook callback in the parameters array by reference and can be modified by the hook callback. The effect of the hook callback's return value is specified where applicable; in addition to this, the hook callback return value will always determine whether or not further callbacks registered on the same hook will be skipped.

**Table 5.2. Hook List**

> This hook list is out of date. Some hooks may not work with newer versions of OJS. Please consult [v3.3 Common Hooks](/dev/documentation/3.3/en/utilities-hooks#common-hooks) and [v3.4 Common Hooks](/dev/documentation/en/utilities-hooks#common-hooks) for currently supported hooks.
{:.warning}

| Name | Parameters | Description |
| ----- | ----- | ----- |
| `LoadHandler` | `&$page`, `&$op`, `&$sourceFile` | Called by OJS's main `index.php`{.filename} script after the page (`&$page`), operation (`&$op`), and handler code file (`&$sourceFile`) names have been determined, but before `$sourceFile` is loaded. Can be used to intercept browser requests for handling by the plugin. Returning `true` from the callback will prevent OJS from loading the handler stub in `$sourceFile`.
Expand Down

0 comments on commit 54f9231

Please sign in to comment.