mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-15 20:53:49 +09:00
Moved LatestMapWidget code into LatestMap class for use in both
widget/shortcode
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user