Skip to content

Commit 2042c70

Browse files
author
Chris Gårdenberg
committed
docs: Added information about Actions
Added a page (and sidebar item) about the WordPress actions available in the plugin, so that people can start building their own integrations more easily.
1 parent a738f5d commit 2042c70

2 files changed

Lines changed: 150 additions & 0 deletions

File tree

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
id: wordpress-actions
3+
title: WordPress Actions
4+
sidebar_label: WordPress Actions
5+
---
6+
7+
Here we have a list of all the actions that are available in the plugin.
8+
9+
:::caution
10+
11+
Please use with care! This can break the functionality of the plugin.
12+
13+
:::
14+
15+
## Actions
16+
17+
Some of the actions will have parameters that are passed to them, they will be explained in the section about the
18+
action.
19+
20+
### `eduadmin-booking-completed`
21+
22+
This event fires when the booking is completed, and the "Thank you"-page is shown (requires the `edu-thankyou` query
23+
parameter to be present)
24+
25+
| Parameter name | Description |
26+
|:----------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
27+
| `$booking_info` | Contains either a [Booking](https://api.eduadmin.se/?page=read#operation/GetSingleBooking) or a [ProgrammeBooking](https://api.eduadmin.se/?page=read#operation/GetSingleProgrammeBooking) |
28+
29+
This event can be used when you want to trigger some custom code after a booking has been completed, like if you want to
30+
trigger a webhook or something similar.
31+
32+
### `eduadmin-bookingcompleted`
33+
34+
An old legacy event that is still available for backwards compatibility, used by some integrations/plugins to handle
35+
payment updates/information.
36+
37+
### `eduadmin-bookingerror`
38+
39+
This event fires when there is an error with the booking.
40+
41+
| Parameter name | Description |
42+
|:---------------|:--------------------------------------------------------------|
43+
| `$error_list` | Contains the error message(s) that was returned from the API. |
44+
45+
### `eduadmin-bookingform-loaded`
46+
47+
This event fires when the booking form is loaded, and the booking form is about to be rendered.
48+
49+
| Parameter name | Description |
50+
|:---------------|:-----------------------------------------------------------------------------------------|
51+
| `$login_user` | Contains information about the user that is logged in (or pseudo user if there is none). |
52+
53+
### `eduadmin-bookingform-view`
54+
55+
This event fires when the booking form has been loaded, and we know what course is shown.
56+
57+
| Parameter name | Description |
58+
|:-------------------|:---------------------------------------------------------------------------------------------------------------------------------------|
59+
| `$selected_course` | Contains the [CourseTemplate](https://api.eduadmin.se/?page=read#operation/GetSingleCourseTemplate) that is shown in the booking form. |
60+
61+
### `eduadmin-checkpaymentplugins`
62+
63+
This event fires when the booking is about to be made, and the plugin is checking if there are any payment plugins that
64+
wants to inject themselves into the booking flow.
65+
66+
| Parameter name | Description |
67+
|:---------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
68+
| `$ebi` | Contains the [EduAdmin_BookingInfo](https://github.com/MultinetInteractive/EduAdmin-WordPress/blob/production/class/class-eduadmin-bookinginfo.php) that has been created. |
69+
70+
Example of how this is used in the plugin for Svea WebPay can be found here:
71+
72+
https://github.com/MultinetInteractive/EduAdmin-WordPress-SveaWebPay/blob/master/class/class-edu-sveawebpay.php#L27
73+
74+
### `eduadmin-detail-view`
75+
76+
This event fires when the detail view is loaded, and the detail view is about to be rendered.
77+
78+
| Parameter name | Description |
79+
|:-------------------|:-------------------------------------------------------------------------------------------------------------------|
80+
| `$selected_course` | Contains the [CourseTemplate](https://api.eduadmin.se/?page=read#operation/GetSingleCourseTemplate) that is shown. |
81+
82+
### `eduadmin-list-course-view`
83+
84+
This event fires when the course list view is loaded, and the list view has been rendered.
85+
86+
| Parameter name | Description |
87+
|:---------------|:--------------------------------------------------------------------------------------------------------------------------------------------|
88+
| `$courses` | Contains an array of the [CourseTemplates](https://api.eduadmin.se/?page=read#operation/GetSingleCourseTemplate) that is shown in the list. |
89+
90+
### `eduadmin-list-event-view`
91+
92+
This event fires when the event list view is loaded, and the list view has been rendered.
93+
94+
| Parameter name | Description |
95+
|:---------------|:--------------------------------------------------------------------------------------------------------------------------|
96+
| `$events` | Contains an array of the [Events](https://api.eduadmin.se/?page=read#operation/GetSingleEvent) that is shown in the list. |
97+
98+
### `eduadmin-list-programme-view`
99+
100+
This event fires when the event list view is loaded, and the list view has been rendered.
101+
102+
| Parameter name | Description |
103+
|:---------------|:----------------------------------------------------------------------------------------------------------------------------------|
104+
| `$programmes` | Contains an array of the [Programmes](https://api.eduadmin.se/?page=read#operation/GetSingleProgramme) that is shown in the list. |
105+
106+
### `eduadmin-plugin-save_<plugin-id>`
107+
108+
This is an internal action, only used to save the options for a plugin.
109+
110+
https://github.com/MultinetInteractive/EduAdmin-WordPress/blob/production/includes/plugin/class-edu-integration.php#L152-L173
111+
112+
### `eduadmin-processbooking`
113+
114+
This event fires when the booking is made, and potential plugins can take part of the booking information for custom
115+
handling.
116+
117+
| Parameter name | Description |
118+
|:---------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
119+
| `$ebi` | Contains the [EduAdmin_BookingInfo](https://github.com/MultinetInteractive/EduAdmin-WordPress/blob/production/class/class-eduadmin-bookinginfo.php) that has been created. |
120+
121+
### `eduadmin-programme-bookingform-view`
122+
123+
This event fires when the programme booking form has been loaded, and we know what programme is shown.
124+
125+
| Parameter name | Description |
126+
|:---------------|:-----------------------------------------------------------------------------------------------------------------------------|
127+
| `$programme` | Contains the [Programme](https://api.eduadmin.se/?page=read#operation/GetSingleProgramme) that is shown in the booking form. |
128+
129+
### `eduadmin-programme-detail-view`
130+
131+
This event fires when the programme detail view is loaded, and the detail view is about to be rendered.
132+
133+
| Parameter name | Description |
134+
|:---------------|:----------------------------------------------------------------------------------------------------------------------------|
135+
| `$programme` | Contains the [Programme](https://api.eduadmin.se/?page=read#operation/GetSingleProgramme) that is shown in the detail view. |
136+
137+
### `edu_integrations_init`
138+
139+
This event fires when the plugin is loaded, and the integrations are about to be loaded.
140+
141+
### `eduadmin_loaded`
142+
143+
This event fires when the plugin is loaded, and the plugin is done initializing.
144+
145+
### `eduadmin_showtimers`
146+
147+
This event fires when the plugin is loaded, and the plugin is about to show the timers.
148+
149+
Can be used, if you want to extend the timer functionality, and add your own timers.

new_website/sidebars.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"docs": {
33
"Getting started": ["getting-started", "shortcodes"],
44
"Custom templates": ["your-first-custom-template"],
5+
"Actions": ["wordpress-actions"],
56
"Troubleshooting": ["troubleshooting"],
67
"Cookies": ["cookies"]
78
}

0 commit comments

Comments
 (0)