Moved LatestMapWidget code into LatestMap class for use in both

widget/shortcode
This commit is contained in:
Justin Foell
2019-11-01 12:57:40 -05:00
parent 4c501ef0de
commit 564d07c0dc
4 changed files with 175 additions and 116 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
/**
* Latest Map Shortcode [latest_map].
* @package WPStrava
*/
/**
* Latest Map Shortcode class.
*
* @author Justin Foell <justin@foell.org>
* @since 2.0.1
*/
class WPStrava_LatestMapShortcode {
/**
* Constructor.
*
* @author Justin Foell <justin@foell.org>
* @since 2.0.1
*/
public function __construct() {
add_shortcode( 'latest_map', array( $this, 'handler' ) );
}
/**
* Shortcode handler for [latest_map].
*
* [latest_map som=metric distance_min=10 client_id=xxx|strava_club_id=yyy]
*
* @param array $atts Array of attributes (client_id, som, etc.).
* @return string Shortcode output
* @author Justin Foell <justin@foell.org>
* @since 2.0.1
*/
public function handler( $atts ) {
return WPStrava_LatestMap::get_map_html( $atts );
}
}