Skip to content

Commit 4ee01c7

Browse files
authored
Merge pull request #504 from MultinetInteractive/master
v4.0.0
2 parents c2a0bfb + 6916b78 commit 4ee01c7

11 files changed

Lines changed: 110 additions & 79 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
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.0.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.1...v4.0.0) (2023-10-10)
6+
7+
8+
### ⚠ BREAKING CHANGES
9+
10+
* **Programme/Shortcodes:** Custom code with `do_shortcode` now needs to do
11+
`echo do_shortcode( '[eduadmin-programme-list]' );` after the change.
12+
Which is the intended way to use `do_shortcode` the previous versions
13+
were not working in the correct way.
14+
15+
### Bug Fixes
16+
17+
* **Programme/Shortcodes:** Fixed an issue with Programme pages ([461c3bf](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/461c3bfac424d8614580ac4f7df2fe5d70161499))
18+
519
### [3.11.1](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.0...v3.11.1) (2023-10-09)
620

721

PLUGIN-CHECKSUM

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
081e6567affebd04ee2bd149100373bf
1+
f225964c4ebc0fdc2db8e51049e166ae

content/template/myPagesTemplate/login.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919
require_once 'profile.php';
2020
}
2121
} else {
22-
if ( isset( $q['edu-login'] ) ) {
23-
require_once 'login-page.php';
24-
} else {
25-
require_once 'login-page.php';
26-
}
22+
require_once 'login-page.php';
2723
}
2824

2925
$out = ob_get_clean();

content/template/programme/book.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
ob_start();
23
// phpcs:disable WordPress.NamingConventions,Squiz
34

45
if ( ! empty( $_POST['edu-valid-form'] ) && wp_verify_nonce( $_POST['edu-valid-form'], 'edu-booking-confirm' ) && isset( $_POST['act'] ) && 'bookProgramme' === sanitize_text_field( $_POST['act'] ) ) {
@@ -643,3 +644,6 @@ class="last-name" name="contactLastName" maxlength="100"
643644
<?php
644645
do_action( 'eduadmin-programme-bookingform-view', $programme );
645646
}
647+
$out = ob_get_clean();
648+
649+
return $out;
Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
11
<?php
2+
ob_start();
23
$show_headers = EDU()->is_checked( 'eduadmin-showDetailHeaders', true );
34
?>
4-
<div class="eduadmin" data-courseid="<?php echo esc_attr( $programme['ProgrammeId'] ); ?>"
5-
data-eventid="<?php echo( isset( $_REQUEST['id'] ) ? esc_attr( sanitize_text_field( $_REQUEST['id'] ) ) : '' ); ?>">
6-
<?php if ( ! empty( $programme['ImageUrl'] ) ) : ?>
7-
<img src="<?php echo esc_url( $programme['ImageUrl'] ); ?>" class="courseImage" />
8-
<?php endif; ?>
9-
<h1 class="courseTitle"><?php echo esc_html( $programme['ProgrammeName'] ); ?></h1>
10-
<?php if ( ! empty( $programme['Description'] ) ) : ?><?php if ( $show_headers ) { ?>
11-
<h2><?php echo esc_html_x( 'Description', 'frontend', 'eduadmin-booking' ); ?></h2>
12-
<?php } ?><?php echo wp_kses_post( $programme['Description'] ); ?><?php endif; ?>
13-
<?php if ( ! empty( $programme['Prerequisites'] ) ) : ?><?php if ( $show_headers ) { ?>
14-
<h2><?php echo esc_html_x( 'Prerequisites', 'frontend', 'eduadmin-booking' ); ?></h2>
15-
<?php } ?><?php echo wp_kses_post( $programme['Prerequisites'] ); ?><?php endif; ?>
16-
<?php if ( ! empty( $programme['TargetGroup'] ) ) : ?><?php if ( $show_headers ) { ?>
17-
<h2><?php echo esc_html_x( 'Target Group', 'frontend', 'eduadmin-booking' ); ?></h2>
18-
<?php } ?><?php echo wp_kses_post( $programme['TargetGroup'] ); ?><?php endif; ?>
19-
<?php if ( ! empty( $programme['Courses'] ) ) : ?><?php if ( $show_headers ) { ?>
20-
<h2><?php echo esc_html_x( 'Modules', 'frontend', 'eduadmin-booking' ); ?></h2>
21-
<?php } ?>
22-
<ul>
23-
<?php
24-
foreach ( $programme['Courses'] as $module ) {
25-
// TODO: Add link to course template page
26-
echo '<li>' . esc_html( $module['CourseName'] ) . '</li>';
27-
}
28-
?>
29-
</ul>
30-
<?php
31-
endif;
32-
?>
33-
<h2><?php echo esc_html_x( 'Programme starts', 'frontend', 'eduadmin-booking' ); ?></h2>
34-
<?php
35-
if ( ! empty( $programme['ProgrammeStarts'] ) ) {
36-
include_once 'template/detail-list.php';
37-
} else {
38-
echo '<i>' . esc_html_x( 'No programme starts available', 'frontend', 'eduadmin-booking' ) . '</i>';
39-
}
5+
<div class="eduadmin" data-courseid="<?php echo esc_attr( $programme['ProgrammeId'] ); ?>"
6+
data-eventid="<?php echo( isset( $_REQUEST['id'] ) ? esc_attr( sanitize_text_field( $_REQUEST['id'] ) ) : '' ); ?>">
7+
<?php if ( ! empty( $programme['ImageUrl'] ) ) : ?>
8+
<img src="<?php echo esc_url( $programme['ImageUrl'] ); ?>" class="courseImage" />
9+
<?php endif; ?>
10+
<h1 class="courseTitle"><?php echo esc_html( $programme['ProgrammeName'] ); ?></h1>
11+
<?php if ( ! empty( $programme['Description'] ) ) : ?><?php if ( $show_headers ) { ?>
12+
<h2><?php echo esc_html_x( 'Description', 'frontend', 'eduadmin-booking' ); ?></h2>
13+
<?php } ?><?php echo wp_kses_post( $programme['Description'] ); ?><?php endif; ?>
14+
<?php if ( ! empty( $programme['Prerequisites'] ) ) : ?><?php if ( $show_headers ) { ?>
15+
<h2><?php echo esc_html_x( 'Prerequisites', 'frontend', 'eduadmin-booking' ); ?></h2>
16+
<?php } ?><?php echo wp_kses_post( $programme['Prerequisites'] ); ?><?php endif; ?>
17+
<?php if ( ! empty( $programme['TargetGroup'] ) ) : ?><?php if ( $show_headers ) { ?>
18+
<h2><?php echo esc_html_x( 'Target Group', 'frontend', 'eduadmin-booking' ); ?></h2>
19+
<?php } ?><?php echo wp_kses_post( $programme['TargetGroup'] ); ?><?php endif; ?>
20+
<?php if ( ! empty( $programme['Courses'] ) ) : ?><?php if ( $show_headers ) { ?>
21+
<h2><?php echo esc_html_x( 'Modules', 'frontend', 'eduadmin-booking' ); ?></h2>
22+
<?php } ?>
23+
<ul>
24+
<?php
25+
foreach ( $programme['Courses'] as $module ) {
26+
// TODO: Add link to course template page
27+
echo '<li>' . esc_html( $module['CourseName'] ) . '</li>';
28+
}
29+
?>
30+
</ul>
31+
<?php
32+
endif;
33+
?>
34+
<h2><?php echo esc_html_x( 'Programme starts', 'frontend', 'eduadmin-booking' ); ?></h2>
35+
<?php
36+
if ( ! empty( $programme['ProgrammeStarts'] ) ) {
37+
include_once 'template/detail-list.php';
38+
} else {
39+
echo '<i>' . esc_html_x( 'No programme starts available', 'frontend', 'eduadmin-booking' ) . '</i>';
40+
}
4041

41-
do_action( 'eduadmin-programme-detail-view', $programme );
42-
?>
43-
</div>
42+
do_action( 'eduadmin-programme-detail-view', $programme );
43+
?>
44+
</div>
45+
<?php
46+
$out = ob_get_clean();
47+
48+
return $out;

content/template/programme/list.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
ob_start();
23
$spot_left_option = EDU()->get_option( 'eduadmin-spotsLeft', 'exactNumbers' );
34
$always_few_spots = EDU()->get_option( 'eduadmin-alwaysFewSpots', '3' );
45
$spot_settings = EDU()->get_option( 'eduadmin-spotsSettings', "1-5\n5-10\n10+" );
@@ -22,3 +23,6 @@
2223
</div>
2324
<?php
2425
}
26+
$out = ob_get_clean();
27+
28+
return $out;

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: 3.11.1
12+
* Version: 4.0.0
1313
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
1414
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
1515
* Requires at least: 5.8

includes/edu-shortcodes.php

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,11 @@ function eduadmin_get_login_view( $attributes ) {
658658
normalize_empty_atts( $attributes ),
659659
'eduadmin-loginview'
660660
);
661-
EDU()->stop_timer( $t );
662661

663-
ob_start();
664-
include_once EDUADMIN_PLUGIN_PATH . '/content/template/myPagesTemplate/login.php';
662+
$str = include_once EDUADMIN_PLUGIN_PATH . '/content/template/myPagesTemplate/login.php';
663+
EDU()->stop_timer( $t );
665664

666-
return ob_get_clean();
665+
return $str;
667666
}
668667

669668
function eduadmin_get_programme_list( $attributes ) {
@@ -699,10 +698,7 @@ function eduadmin_get_programme_list( $attributes ) {
699698
'StartDate),Courses'
700699
);
701700

702-
ob_start();
703-
include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/list.php';
704-
705-
return ob_get_clean();
701+
return include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/list.php';
706702
}
707703

708704
function eduadmin_get_programme_details( $attributes ) {
@@ -753,11 +749,10 @@ function eduadmin_get_programme_details( $attributes ) {
753749
'),PriceNames'
754750
);
755751

756-
ob_start();
757-
include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/detail.php';
758-
759-
return ob_get_clean();
752+
return include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/detail.php';
760753
}
754+
755+
return '';
761756
}
762757

763758
function eduadmin_get_programme_booking( $attributes ) {
@@ -804,11 +799,10 @@ function eduadmin_get_programme_booking( $attributes ) {
804799
'Courses,Events,PaymentMethods,PriceNames'
805800
);
806801

807-
ob_start();
808-
include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/book.php';
809-
810-
return ob_get_clean();
802+
return include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/book.php';
811803
}
804+
805+
return '';
812806
}
813807

814808
if ( is_callable( 'add_shortcode' ) ) {

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": "3.11.1",
4+
"version": "4.0.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: 15 additions & 8 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: 3.11.1
4+
- Stable tag: 4.0.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,20 @@ 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.0.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.1...v4.0.0) (2023-10-10)
44+
45+
46+
#### ⚠ BREAKING CHANGES
47+
48+
* **Programme/Shortcodes:** Custom code with `do_shortcode` now needs to do
49+
`echo do_shortcode( '[eduadmin-programme-list]' );` after the change.
50+
Which is the intended way to use `do_shortcode` the previous versions
51+
were not working in the correct way.
52+
53+
#### Bug Fixes
54+
55+
* **Programme/Shortcodes:** Fixed an issue with Programme pages ([461c3bf](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/461c3bfac424d8614580ac4f7df2fe5d70161499))
56+
4357
### [3.11.1](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.0...v3.11.1) (2023-10-09)
4458

4559

@@ -61,12 +75,5 @@ The full changelog available on [GitHub](https://github.com/MultinetInteractive/
6175

6276
* Programme starts now show number of spots left (according to settings) ([0117df4](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/0117df408a557998bd04d467720e51cef331612a)), closes [#498](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/498)
6377

64-
### [3.9.2](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.9.1...v3.9.2) (2023-09-26)
65-
66-
67-
#### Refactoring
68-
69-
* Made a readme.txt as well, for use in the SVN trunk. ([e6b6d61](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/e6b6d61b8e3f27c2841c25812f46f6d2cde3ead3))
70-
7178

7279

0 commit comments

Comments
 (0)