Skip to content

Commit 7210596

Browse files
authored
Merge pull request #512 from MultinetInteractive/master
v4.2.0
2 parents 2b0ffd2 + 4d674d2 commit 7210596

7 files changed

Lines changed: 73 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [4.2.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.1.2...v4.2.0) (2023-12-21)
6+
7+
8+
### Features
9+
10+
* Support for the required fields in Google Search Console for the ld+json ([519a446](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/519a446527a37ae8ffc7e3d159ea99c5c9d86e45)), closes [#511](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/511)
11+
512
### [4.1.2](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.1.1...v4.1.2) (2023-12-13)
613

714

PLUGIN-CHECKSUM

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cdd0ea0b06aff3d7785588cc028f49ea
1+
3de0d7f8f7f89943ea03086bef2fce18

content/template/data/ld-json.php

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,29 @@
4949
return;
5050
}
5151

52+
$prices = array();
53+
54+
if ( ! empty( $selected_course['PriceNames'] ) ) {
55+
foreach ( $selected_course['PriceNames'] as $pn ) {
56+
$prices[ (string) $pn['PriceNameId'] ] = $pn;
57+
}
58+
}
59+
5260
$org_name = trim( ! empty( $organization['LegalName'] ) ? $organization['LegalName'] : $organization['OrganisationName'] );
5361

54-
$events = null;
62+
$events = [];
63+
64+
$offers = [];
65+
66+
foreach ( $prices as $priceNameId => $priceName ) {
67+
$offers[] = [
68+
'@type' => 'Offer',
69+
'price' => $priceName['Price'],
70+
'category' => $priceName['Price'] == 0 ? 'Free' : 'Paid',
71+
'priceCurrency' => EDU()->get_option( 'eduadmin-currency', 'SEK' ),
72+
'name' => $priceName['PriceNameDescription'],
73+
];
74+
}
5575

5676
foreach ( $selected_course['Events'] as $event ) {
5777
$_event = [
@@ -63,10 +83,35 @@
6383
$_event['courseMode'] = "online";
6484
$_event['location'] = "Online";
6585
$_event['description'] = 'On-demand';
86+
87+
if ( $event['OnDemandAccessDays'] == null && $selected_course['OnDemandAccessDays'] != null ) {
88+
$event['OnDemandAccessDays'] = $selected_course['OnDemandAccessDays'];
89+
}
90+
91+
if ( $event['OnDemandAccessDays'] > 0 ) {
92+
$_event['courseSchedule'] = [
93+
'@type' => 'Schedule',
94+
'repeatFrequency' => 'Daily',
95+
'repeatCount' => $event['OnDemandAccessDays'],
96+
];
97+
} else {
98+
$_event['courseSchedule'] = [
99+
'@type' => 'Schedule',
100+
'duration' => 'P1D',
101+
'repeatFrequency' => 'Yearly',
102+
'repeatCount' => 99,
103+
];
104+
}
66105
} else {
67106
$_event['location'] = $event['City'];
68107
$_event['startDate'] = $event['StartDate'];
69108
$_event['endDate'] = $event['EndDate'];
109+
110+
$_event['courseSchedule'] = [
111+
'@type' => 'Schedule',
112+
'startDate' => $event['StartDate'],
113+
'endDate' => $event['EndDate'],
114+
];
70115
}
71116

72117
if ( ! empty( $event['MaxParticipantNumber'] ) && $event['MaxParticipantNumber'] > 0 ) {
@@ -93,6 +138,7 @@
93138
'image' => $organization['LogoUrl'],
94139
],
95140
'hasCourseInstance' => $events,
141+
'offers' => $offers,
96142
];
97143

98144
echo '<script type="application/ld+json">

eduadmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Plugin URI: https://www.eduadmin.se
1010
* Description: EduAdmin plugin to allow visitors to book courses at your website
1111
* Tags: booking, participants, courses, events, eduadmin, lega online
12-
* Version: 4.1.2
12+
* Version: 4.2.0
1313
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
1414
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
1515
* Requires at least: 5.8

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eduadmin-wordpress-plugin",
33
"private": true,
4-
"version": "4.1.2",
4+
"version": "4.2.0",
55
"repository": "https://github.com/MultinetInteractive/EduAdmin-WordPress.git",
66
"author": "Chris Gårdenberg <chga@multinet.se>",
77
"license": "MIT",

readme.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# EduAdmin Booking
22
- Requires at least: 5.8
33
- Tested up to: 6.4
4-
- Stable tag: 4.1.2
4+
- Stable tag: 4.2.0
55
- Requires PHP: 7.0
66
- License: GPL3
77
- License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -40,6 +40,13 @@ If you notice that your API key doesn't work any more, you have to contact us.
4040

4141
The full changelog available on [GitHub](https://github.com/MultinetInteractive/EduAdmin-WordPress/blob/production/CHANGELOG.md)
4242

43+
### [4.2.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.1.2...v4.2.0) (2023-12-21)
44+
45+
46+
#### Features
47+
48+
* Support for the required fields in Google Search Console for the ld+json ([519a446](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/519a446527a37ae8ffc7e3d159ea99c5c9d86e45)), closes [#511](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/511)
49+
4350
### [4.1.2](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.1.1...v4.1.2) (2023-12-13)
4451

4552

@@ -66,19 +73,5 @@ The full changelog available on [GitHub](https://github.com/MultinetInteractive/
6673

6774
* **Shortcodes:** Added info about the new shortcode ([4fe4b80](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/4fe4b8015c095841a75cfd5348ece89bfb90944a)), closes [#506](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/506)
6875

69-
### [4.0.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.1...v4.0.0) (2023-10-10)
70-
71-
72-
#### ⚠ BREAKING CHANGES
73-
74-
* **Programme/Shortcodes:** Custom code with `do_shortcode` now needs to do
75-
`echo do_shortcode( '[eduadmin-programme-list]' );` after the change.
76-
Which is the intended way to use `do_shortcode` the previous versions
77-
were not working in the correct way.
78-
79-
#### Bug Fixes
80-
81-
* **Programme/Shortcodes:** Fixed an issue with Programme pages ([461c3bf](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/461c3bfac424d8614580ac4f7df2fe5d70161499))
82-
8376

8477

readme.txt

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: mnchga
33
Tags: booking, participants, courses, events, eduadmin, lega online
44
Requires at least: 5.8
55
Tested up to: 6.4
6-
Stable tag: 4.1.2
6+
Stable tag: 4.2.0
77
Requires PHP: 7.0
88
License: GPL3
99
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -45,6 +45,13 @@ If you notice that your API key doesn't work any more, you have to contact us.
4545

4646
The full changelog available on [GitHub](https://github.com/MultinetInteractive/EduAdmin-WordPress/blob/production/CHANGELOG.md)
4747

48+
### [4.2.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.1.2...v4.2.0) (2023-12-21)
49+
50+
51+
#### Features
52+
53+
* Support for the required fields in Google Search Console for the ld+json ([519a446](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/519a446527a37ae8ffc7e3d159ea99c5c9d86e45)), closes [#511](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/511)
54+
4855
### [4.1.2](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.1.1...v4.1.2) (2023-12-13)
4956

5057

@@ -71,19 +78,5 @@ The full changelog available on [GitHub](https://github.com/MultinetInteractive/
7178

7279
* **Shortcodes:** Added info about the new shortcode ([4fe4b80](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/4fe4b8015c095841a75cfd5348ece89bfb90944a)), closes [#506](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/506)
7380

74-
### [4.0.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.1...v4.0.0) (2023-10-10)
75-
76-
77-
#### ⚠ BREAKING CHANGES
78-
79-
* **Programme/Shortcodes:** Custom code with `do_shortcode` now needs to do
80-
`echo do_shortcode( '[eduadmin-programme-list]' );` after the change.
81-
Which is the intended way to use `do_shortcode` the previous versions
82-
were not working in the correct way.
83-
84-
#### Bug Fixes
85-
86-
* **Programme/Shortcodes:** Fixed an issue with Programme pages ([461c3bf](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/461c3bfac424d8614580ac4f7df2fe5d70161499))
87-
8881

8982

0 commit comments

Comments
 (0)