Skip to content

Commit

Permalink
WPCIVIUX-98 Event URLs must be absolute as this shortcode may be used…
Browse files Browse the repository at this point in the history
… by the au.com.agileware.evaluatewpshortcode extension
  • Loading branch information
agileware-justin committed Jun 1, 2021
1 parent 8bca2a6 commit 6f26e80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions civicrm-ux.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin Name: WP CiviCRM UX
* Plugin URI: https://github.com/agileware/wp-civicrm-ux
* Description: A better user experience for integrating WordPress and CiviCRM
* Version: 1.4.0
* Version: 1.4.1
* Author: Agileware
* Author URI: https://agileware.com.au/
* License: GPL-2.0+
Expand All @@ -24,7 +24,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'CIVICRM_UXVERSION', '1.4.0' );
define( 'CIVICRM_UXVERSION', '1.4.1' );

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
Expand Down
6 changes: 4 additions & 2 deletions shortcodes/event/event-listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ private function get_event_item_html(array $event) {
}

private function get_event_register_link_html(string $event_id) {
$url = CRM_Utils_System::url('civicrm/event/register', ['id' => $event_id]);
// URLs must be absolute as this shortcode may be used by the au.com.agileware.evaluatewpshortcode extension
$url = CRM_Utils_System::url('civicrm/event/register', ['id' => $event_id],TRUE,NULL,TRUE,TRUE);
return '<a target=_blank href="' . $url . '">Register now</a>';
}

private function get_event_info_link_html(string $event_id, string $text = 'More information') {
$url = CRM_Utils_System::url('civicrm/event/info', ['id' => $event_id]);
// URLs must be absolute as this shortcode may be used by the au.com.agileware.evaluatewpshortcode extension
$url = CRM_Utils_System::url('civicrm/event/info', ['id' => $event_id],TRUE,NULL,TRUE,TRUE);
return '<a target=_blank href="' . $url . '">' . $text . '</a>';
}

Expand Down

0 comments on commit 6f26e80

Please sign in to comment.