diff --git a/css/wp-strava.css b/css/wp-strava.css
index 4331325..03574ac 100755
--- a/css/wp-strava.css
+++ b/css/wp-strava.css
@@ -32,6 +32,3 @@
.activity-details-table-units {
font-size: 0.8em;
}
-.wp-strava-activity-container img {
- max-width: none;
-}
diff --git a/lib/WPStrava/ActivityShortcode.php b/lib/WPStrava/ActivityShortcode.php
index 7044b15..3b694de 100644
--- a/lib/WPStrava/ActivityShortcode.php
+++ b/lib/WPStrava/ActivityShortcode.php
@@ -53,9 +53,16 @@ class WPStrava_ActivityShortcode {
'map_height' => '320',
'athlete_token' => WPStrava::get_instance()->settings->get_default_token(),
'markers' => false,
+ 'image_only' => false,
);
- $atts = shortcode_atts( $defaults, $atts );
+ $atts = shortcode_atts( $defaults, $atts, 'activity' );
+
+ /* Make sure boolean values are actually boolean
+ * @see https://wordpress.stackexchange.com/a/119299
+ */
+ $atts['markers'] = filter_var( $atts['markers'], FILTER_VALIDATE_BOOLEAN );
+ $atts['image_only'] = filter_var( $atts['image_only'], FILTER_VALIDATE_BOOLEAN );
$strava_som = WPStrava_SOM::get_som( $atts['som'] );
$activity = WPStrava::get_instance()->activity;
@@ -74,42 +81,46 @@ class WPStrava_ActivityShortcode {
$map_height = str_replace( 'px', '', $map_height );
if ( $activity_details ) {
- return '
-
';
+ $activity_output = '';
+ return $activity_output;
} // End if( $activity_details ).
}
diff --git a/lib/WPStrava/RouteShortcode.php b/lib/WPStrava/RouteShortcode.php
index d30be37..99a7981 100644
--- a/lib/WPStrava/RouteShortcode.php
+++ b/lib/WPStrava/RouteShortcode.php
@@ -55,7 +55,12 @@ class WPStrava_RouteShortcode {
'markers' => false,
);
- $atts = shortcode_atts( $defaults, $atts );
+ $atts = shortcode_atts( $defaults, $atts, 'route' );
+
+ /* Make sure boolean values are actually boolean
+ * @see https://wordpress.stackexchange.com/a/119299
+ */
+ $atts['markers'] = filter_var( $atts['markers'], FILTER_VALIDATE_BOOLEAN );
$strava_som = WPStrava_SOM::get_som( $atts['som'] );
$route = WPStrava::get_instance()->routes;
diff --git a/readme.txt b/readme.txt
index 8297f50..6567157 100755
--- a/readme.txt
+++ b/readme.txt
@@ -72,12 +72,18 @@ WP-Strava caches activity for one hour so your site doesn't hit the Strava API o
6. Activity Shortcode - Shows a map of activity with some statistics.
7. Activity Shortcode Settings - An example activity shortcode. The athlete_token parameter is only needed if your site is connected to multiple athlete accounts.
8. Route Shortcode - Shows a map of a route.
-9. Route Shortcode Settings - An example route shortcode. Add markers=true to show green/red start stop points.
+9. Route Shortcode Settings - An example route shortcode. Add markers=true to show green/red start/stop points.
10. Activities Shortcode - Shows latest athlete activity in a page or post.
11. Activities Shortcode Settings - An example activities shortcode. The athlete_token parameter is only needed if your site is connected to multiple athlete accounts.
== Changelog ==
+= 1.6.1 =
+
+Added 'image_only' attribute to [activity] shortcode to optionally remove data table.
+Added boolean filtering to shortcodes to prevent false-positive "truthiness" to a shortcode attribute like markers="false".
+Removed 'max-width: none' from activity image to make it responsive.
+
= 1.6.0 =
Added class autoloader (removed composer autoloader).
diff --git a/wp-strava.php b/wp-strava.php
index 2cae3e8..e2e4aed 100755
--- a/wp-strava.php
+++ b/wp-strava.php
@@ -3,7 +3,7 @@
* Plugin Name: WP Strava
* Plugin URI: https://wordpress.org/plugins/wp-strava/
* Description: Show your strava.com activity on your WordPress site. Some Icons are Copyright © Yusuke Kamiyamane. All rights reserved. Licensed under a Creative Commons Attribution 3.0 license.
- * Version: 1.6.0
+ * Version: 1.6.1
* Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott
* License: GPL2
* Text Domain: wp-strava