From 2e8d7c0c30207170e7f71c9321970a0e7a83d91e Mon Sep 17 00:00:00 2001 From: Justin Foell <630830+jrfoell@users.noreply.github.com> Date: Thu, 24 Dec 2020 11:11:24 -0600 Subject: [PATCH 1/2] Replaced old shortcode echo with return --- src/WPStrava/LatestMap.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/WPStrava/LatestMap.php b/src/WPStrava/LatestMap.php index 67edac4..a28815d 100644 --- a/src/WPStrava/LatestMap.php +++ b/src/WPStrava/LatestMap.php @@ -1,7 +1,20 @@ + * @since 2.1.0 + */ public static function get_map_html( $args ) { $defaults = array( 'client_id' => WPStrava::get_instance()->settings->get_default_id(), @@ -35,7 +48,7 @@ class WPStrava_LatestMap { $activity = current( $activities ); - echo empty( $activity->map ) ? + return empty( $activity->map ) ? // Translators: Text with activity name shown in place of image if not available. esc_html( sprintf( __( 'Map not available for activity "%s"', 'wp-strava' ), $activity->name ) ) : // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- Image OK. From cc835e089ce1b85ada3458bd099604197327d820 Mon Sep 17 00:00:00 2001 From: Justin Foell <630830+jrfoell@users.noreply.github.com> Date: Thu, 24 Dec 2020 11:15:32 -0600 Subject: [PATCH 2/2] Added latest_map fix to readme.txt --- readme.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/readme.txt b/readme.txt index 3ea91d3..944351e 100755 --- a/readme.txt +++ b/readme.txt @@ -112,6 +112,11 @@ On the WP-Strava settings page you cannot currently remove and add another athle == Changelog == + += Unreleased = + +Fix latest_map class replacing echo with return https://wordpress.org/support/topic/latest-activity-map-shortcode-wrong-placed-on-page/ + = 2.5.0 = Fix missing translation domain on "Save Changes" in settings. https://wordpress.org/support/topic/small-fix-in-settings-php-function-print_clear_input