Skip to content

Commit

Permalink
Merge pull request #532 from MultinetInteractive/master
Browse files Browse the repository at this point in the history
v5.2.0
  • Loading branch information
itssimple authored Nov 4, 2024
2 parents 0fee8da + 8b8a658 commit dde7572
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 85 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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.

## [5.2.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v5.1.3...v5.2.0) (2024-11-04)


### Features

* Setting to turn off/on OG/metadata and LD+JSON. ([594c422](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/594c422407be2aa6f8a4d2192f5636faac85975b)), closes [#520](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/520)


### Bug Fixes

* Added repeatFrequency, repeatCount and courseMode for LD+JSON ([e5e5c42](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/e5e5c42bfe37d39c088e6901c2de3e7f31841e75)), closes [#511](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/511)

### [5.1.3](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v5.1.2...v5.1.3) (2024-10-10)

### [5.1.2](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v5.1.1...v5.1.2) (2024-10-10)
Expand Down
2 changes: 1 addition & 1 deletion PLUGIN-CHECKSUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dfe92ac2cbf028316a32bfd76b493a0f
f43f26b58da1439fef621c2813477a7d
24 changes: 16 additions & 8 deletions content/template/data/ld-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
return;
}

$show_extra_metadata = EDU()->is_checked( 'eduadmin-showExtraMetadata', "on" );

if ( ! $show_extra_metadata ) {
return;
}

$group_by_city = EDU()->is_checked( 'eduadmin-groupEventsByCity' );
$group_by_city_class = '';

Expand Down Expand Up @@ -80,8 +86,7 @@
];

if ( $is_ondemand ) {
$_event['courseMode'] = "online";
$_event['location'] = "Online";
$_event['courseMode'] = "Online";
$_event['description'] = 'On-demand';

if ( $event['OnDemandAccessDays'] == null && $selected_course['OnDemandAccessDays'] != null ) {
Expand All @@ -103,14 +108,17 @@
];
}
} else {
$_event['location'] = $event['City'];
$_event['startDate'] = $event['StartDate'];
$_event['endDate'] = $event['EndDate'];
$_event['courseMode'] = "Onsite";
$_event['location'] = $event['City'];
$_event['startDate'] = $event['StartDate'];
$_event['endDate'] = $event['EndDate'];

$_event['courseSchedule'] = [
'@type' => 'Schedule',
'startDate' => $event['StartDate'],
'endDate' => $event['EndDate'],
'@type' => 'Schedule',
'startDate' => $event['StartDate'],
'endDate' => $event['EndDate'],
'repeatFrequency' => 'Daily',
'repeatCount' => count( $event['EventDates'] ),
];
}

Expand Down
6 changes: 6 additions & 0 deletions content/template/data/ogp.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
return;
}

$show_extra_metadata = EDU()->is_checked( 'eduadmin-showExtraMetadata', "on" );

if ( ! $show_extra_metadata ) {
return;
}

$group_by_city = EDU()->is_checked( 'eduadmin-groupEventsByCity' );
$group_by_city_class = '';

Expand Down
2 changes: 1 addition & 1 deletion eduadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin URI: https://www.eduadmin.se
* Description: EduAdmin plugin to allow visitors to book courses at your website
* Tags: booking, participants, courses, events, eduadmin, lega online
* Version: 5.1.3
* Version: 5.2.0
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
* Requires at least: 6.0
Expand Down
1 change: 1 addition & 0 deletions includes/edu-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ function eduadmin_settings_init() {
register_setting( 'eduadmin-rewrite', 'eduadmin-monthsToFetch' );
register_setting( 'eduadmin-rewrite', 'eduadmin-showVatTexts' );
register_setting( 'eduadmin-rewrite', 'eduadmin-showPricesAsSelected' );
register_setting( 'eduadmin-rewrite', 'eduadmin-showExtraMetadata' );

if ( is_admin() ) {
wp_enqueue_script( 'jquery' );
Expand Down
2 changes: 1 addition & 1 deletion includes/edu-text-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ function edu_get_date_range( $days, $short, $event, $show_days, $always_show_sch
$ret =
'<span class="edu-manyDays" title="' . esc_attr_x( 'Show schedule', 'frontend', 'eduadmin-booking' ) . '" onclick="edu_openDatePopup(this);">' .
/* translators: 1: Number of days 2: Date range */
wp_kses_post( sprintf( _nx( '%1$d day on %2$s', '%1$d days between %2$s', count( $days ), 'frontend', 'eduadmin-booking' ), count( $days ), get_start_end_display_date( $days[0], end( $days ), $short, null, false, $force_show_times ) ) ) .
wp_kses_post( sprintf( _nx( '%1$d day, %2$s', '%1$d days between %2$s', count( $days ), 'frontend', 'eduadmin-booking' ), count( $days ), get_start_end_display_date( $days[0], end( $days ), $short, null, false, $force_show_times ) ) ) .
'</span><div class="edu-DayPopup">
<b>' . esc_html_x( 'Schedule', 'frontend', 'eduadmin-booking' ) . '</b><br />
' . join( "<br />\n", $ordered_dategroups ) . '
Expand Down
Loading

0 comments on commit dde7572

Please sign in to comment.