From ade4debd7cc4848be33cf55ce96c261a7d8351af Mon Sep 17 00:00:00 2001 From: Justin Foell <630830+jrfoell@users.noreply.github.com> Date: Fri, 24 Sep 2021 13:33:36 -0500 Subject: [PATCH] Avoid undefined property calories --- readme.txt | 7 +++++-- src/WPStrava/ActivitiesListRenderer.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index f2f63a7..16120b1 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Contributors: cmanon, jrfoell, lancewillett, dlintott, sebastianerb Tags: strava, activity, bicycle, cycling, biking, running, run, swimming, swim, paddle, kayak, gps, shortcode, widget, plugin, block, blocks Requires at least: 4.6 Tested up to: 5.8 -Stable tag: 2.9.1 +Stable tag: 2.9.2 Requires PHP: 5.3 License: GPLv2 or later @@ -135,11 +135,14 @@ On the WP-Strava settings page you cannot currently remove and add another athle == Changelog == = 2.9.2 = -Add ability to paste Activity/Route/Segment URL into the block editor +Add ability to paste Activity/Route/Segment URL into the block editor and have it insert the appropriate block https://wordpress.org/support/topic/sorry-this-content-could-not-be-embedded-5/ +Add `reduce_polyline()` for maps with large polylines but no summary provided (prevents empty map) https://wordpress.org/support/topic/map-embed-from-segment-shows-default-map/ + = 2.9.1 = Add conditional to look for zero/null/empty activity time to avoid exception https://wordpress.org/support/topic/exception-thrown-oceanwp-theme/ + = 2.9.0 = Added Segment Block https://wordpress.org/support/topic/show-segments-feature/ / https://wordpress.org/support/topic/embed-segments-feature/ Switched Activities List to display moving time instead of elapsed time https://wordpress.org/support/topic/moving-time-instead-of-elapsed-time/ diff --git a/src/WPStrava/ActivitiesListRenderer.php b/src/WPStrava/ActivitiesListRenderer.php index c80d530..afbee3d 100644 --- a/src/WPStrava/ActivitiesListRenderer.php +++ b/src/WPStrava/ActivitiesListRenderer.php @@ -83,7 +83,7 @@ class WPStrava_ActivitiesListRenderer { $response .= sprintf( __( ' climbing %1$s %2$s', 'wp-strava' ), $som->elevation( $activity->total_elevation_gain ), $som->get_elevation_label() ); } - if ( $activity->calories ) { + if ( ! empty( $activity->calories ) ) { // LOL - empty calories :^) // Translators: "burning 200 calories." $response .= sprintf( __( ' burning %1$s calories.', 'wp-strava' ), $som->calories( $activity->calories ) ); }