diff --git a/lib/RideShortcode.class.php b/lib/ActivityShortcode.class.php similarity index 83% rename from lib/RideShortcode.class.php rename to lib/ActivityShortcode.class.php index 975e392..92289db 100644 --- a/lib/RideShortcode.class.php +++ b/lib/ActivityShortcode.class.php @@ -1,6 +1,6 @@ 0, - 'som' => WPStrava::get_instance()->settings->som, - 'map_width' => '480', - 'map_height' => '320', + 'id' => 0, + 'som' => WPStrava::get_instance()->settings->som, + 'map_width' => '480', + 'map_height' => '320', + 'athlete_token' => WPStrava::get_instance()->settings->get_default_token(), ); extract( shortcode_atts( $defaults, $atts ) ); $strava_som = WPStrava_SOM::get_som( $som ); - $strava_ride = WPStrava::get_instance()->rides; - $ride_details = $strava_ride->getRide( $id ); + $activity = WPStrava::get_instance()->rides; + $ride_details = $activity->getRide( $athlete_token, $id ); //sanitize width & height - $map_width = str_replace( '%', '', $map_width ); + $map_width = str_replace( '%', '', $map_width ); $map_height = str_replace( '%', '', $map_height ); - $map_width = str_replace( 'px', '', $map_width ); + $map_width = str_replace( 'px', '', $map_width ); $map_height = str_replace( 'px', '', $map_height ); if ( $ride_details ) { @@ -82,4 +83,4 @@ public static function print_scripts() { } // Initialize short code -WPStrava_RideShortcode::init(); +WPStrava_ActivityShortcode::init(); diff --git a/lib/Strava.class.php b/lib/Strava.class.php index b0fb7e3..375f751 100644 --- a/lib/Strava.class.php +++ b/lib/Strava.class.php @@ -4,7 +4,7 @@ require_once WPSTRAVA_PLUGIN_DIR . 'lib/SOM.class.php'; require_once WPSTRAVA_PLUGIN_DIR . 'lib/LatestRidesWidget.class.php'; require_once WPSTRAVA_PLUGIN_DIR . 'lib/LatestMapWidget.class.php'; -require_once WPSTRAVA_PLUGIN_DIR . 'lib/RideShortcode.class.php'; +require_once WPSTRAVA_PLUGIN_DIR . 'lib/ActivityShortcode.class.php'; require_once WPSTRAVA_PLUGIN_DIR . 'lib/StaticMap.class.php'; class WPStrava {