Updated version to 1.1

Added Lance Willet
Tested WP 4.2
Check for WP error on Strava POST
Fix static method in RideShortcode
Add Title to Latest Map Widget
This commit is contained in:
Justin Foell
2015-05-11 22:28:33 -05:00
parent 6f6ed94329
commit fca88020a5
6 changed files with 42 additions and 29 deletions
+2 -7
View File
@@ -30,7 +30,7 @@ class WPStrava_LatestRidesWidget extends WP_Widget {
?>
<?php echo $before_widget; ?>
<?php if ( $title ) echo $before_title . $title . $after_title; ?>
<?php echo $this->strava_request_handler( $strava_club_id, $strava_som_option, $quantity ); ?>
<?php echo $this->strava_request_handler( $strava_club_id, $quantity ); ?>
<?php echo $after_widget; ?>
<?php
}
@@ -39,11 +39,6 @@ class WPStrava_LatestRidesWidget extends WP_Widget {
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags( $new_instance['title'] );
if( in_array( $new_instance['strava_som_option'], array( 'metric', 'english' ) ) ) {
$instance['strava_som_option'] = $new_instance['strava_som_option'];
} else {
$instance['strava_som_option'] = 'metric';
}
$instance['strava_club_id'] = strip_tags( $new_instance['strava_club_id'] );
$instance['quantity'] = $new_instance['quantity'];
@@ -74,7 +69,7 @@ class WPStrava_LatestRidesWidget extends WP_Widget {
// The handler to the ajax call, we will avoid this if Strava support jsonp request and we can do it
// the parsing directly on the jQuery ajax call, the returned text will be enclosed in the $response variable.
private function strava_request_handler( $strava_club_id, $strava_som_option, $quantity ) {
private function strava_request_handler( $strava_club_id, $quantity ) {
$strava_rides = WPStrava::get_instance()->rides;