Add image_only flag to [route] shortcode;

Refine table addition
This commit is contained in:
Justin Foell
2019-02-01 14:16:28 -06:00
parent 7298a73671
commit 629d8c3c59
2 changed files with 63 additions and 40 deletions
+10 -8
View File
@@ -73,23 +73,25 @@ class WPStrava_ActivityShortcode {
return $e->to_html();
}
//sanitize width & height
$map_width = str_replace( '%', '', $atts['map_width'] );
$map_height = str_replace( '%', '', $atts['map_height'] );
$map_width = str_replace( 'px', '', $map_width );
$map_height = str_replace( 'px', '', $map_height );
$activity_output = '';
if ( $activity_details ) {
$activity_output = '<div id="activity-header-' . $atts['id'] . '" class="wp-strava-activity-container">';
$activity_output .= '<div id="activity-header-' . $atts['id'] . '" class="wp-strava-activity-container">';
if ( ! $atts['image_only'] ) {
$activity_output .= $this->get_table( $activity_details, $atts['som'] );
}
// Sanitize width & height.
$map_width = str_replace( '%', '', $atts['map_width'] );
$map_height = str_replace( '%', '', $atts['map_height'] );
$map_width = str_replace( 'px', '', $map_width );
$map_height = str_replace( 'px', '', $map_height );
$activity_output .= '<a title="' . $activity_details->name . '" href="' . WPStrava_Activity::ACTIVITIES_URL . $activity_details->id . '">' .
WPStrava_StaticMap::get_image_tag( $activity_details, $map_height, $map_width, $atts['markers'] ) .
'</a>
</div>';
return $activity_output;
} // End if( $activity_details ).
return $activity_output;
}
/**