mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-17 13:43:50 +09:00
Updated instructions and changelog
This commit is contained in:
@@ -10,13 +10,13 @@ class WPStrava_LatestMapWidget extends WP_Widget {
|
||||
parent::__construct(
|
||||
false,
|
||||
__( 'Strava Latest Map', 'wp-strava' ), // Name
|
||||
array( 'description' => __( 'Strava latest ride using static google map image', 'wp-strava' ) ) // Args.
|
||||
array( 'description' => __( 'Strava latest activity using static google map image', 'wp-strava' ) ) // Args.
|
||||
);
|
||||
}
|
||||
|
||||
public function form( $instance ) {
|
||||
// outputs the options form on admin
|
||||
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Latest Activity', 'wp-strava' );
|
||||
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Latest Activity Map', 'wp-strava' );
|
||||
$all_tokens = WPStrava::get_instance()->settings->get_all_tokens();
|
||||
$athlete_token = isset( $instance['athlete_token'] ) ? esc_attr( $instance['athlete_token'] ) : WPStrava::get_instance()->settings->get_default_token();
|
||||
$distance_min = isset( $instance['distance_min'] ) ? esc_attr( $instance['distance_min'] ) : '';
|
||||
@@ -62,7 +62,7 @@ class WPStrava_LatestMapWidget extends WP_Widget {
|
||||
public function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
|
||||
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Latest Activity', 'wp-strava' ) : $instance['title'] );
|
||||
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Latest Activity Map', 'wp-strava' ) : $instance['title'] );
|
||||
$athlete_token = isset( $instance['athlete_token'] ) ? $instance['athlete_token'] : WPStrava::get_instance()->settings->get_default_token();
|
||||
$distance_min = $instance['distance_min'];
|
||||
$strava_club_id = empty( $instance['strava_club_id'] ) ? null : $instance['strava_club_id'];
|
||||
|
||||
@@ -7,7 +7,7 @@ class WPStrava_LatestRidesWidget extends WP_Widget {
|
||||
|
||||
public function __construct() {
|
||||
$widget_ops = array( 'classname' => 'LatestRidesWidget', 'description' => __( 'Will publish your latest rides activity from strava.com.', 'wp-strava' ) );
|
||||
parent::__construct( 'wp-strava', $name = __( 'Strava Latest Rides', 'wp-strava' ), $widget_ops );
|
||||
parent::__construct( 'wp-strava', $name = __( 'Strava Latest Activity List', 'wp-strava' ), $widget_ops );
|
||||
add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue' ) );
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class WPStrava_LatestRidesWidget extends WP_Widget {
|
||||
extract( $args );
|
||||
|
||||
//$widget_id = $args['widget_id'];
|
||||
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Rides', 'wp-strava' ) : $instance['title'] );
|
||||
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Activity', 'wp-strava' ) : $instance['title'] );
|
||||
$athlete_token = isset( $instance['athlete_token'] ) ? $instance['athlete_token'] : WPStrava::get_instance()->settings->get_default_token();
|
||||
$strava_club_id = empty( $instance['strava_club_id'] ) ? '' : $instance['strava_club_id'];
|
||||
$quantity = empty( $instance['quantity'] ) ? '5' : $instance['quantity'];
|
||||
@@ -48,7 +48,7 @@ class WPStrava_LatestRidesWidget extends WP_Widget {
|
||||
|
||||
/** @see WP_Widget::form */
|
||||
public function form( $instance ) {
|
||||
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Rides', 'wp-strava' );
|
||||
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Activity', 'wp-strava' );
|
||||
$all_tokens = WPStrava::get_instance()->settings->get_all_tokens();
|
||||
$athlete_token = isset( $instance['athlete_token'] ) ? esc_attr( $instance['athlete_token'] ) : WPStrava::get_instance()->settings->get_default_token();
|
||||
$strava_club_id = isset( $instance['strava_club_id'] ) ? esc_attr( $instance['strava_club_id'] ) : '';
|
||||
|
||||
+17
-5
@@ -138,6 +138,7 @@ class WPStrava_Settings {
|
||||
public function print_api_instructions() {
|
||||
$signup_url = 'http://www.strava.com/developers';
|
||||
$settings_url = 'https://www.strava.com/settings/api';
|
||||
$icon_url = 'https://plugins.svn.wordpress.org/wp-strava/assets/icon-128x128.png';
|
||||
$blog_name = get_bloginfo( 'name' );
|
||||
$app_name = sprintf( esc_html( '%s Strava', 'wp-strava' ), $blog_name );
|
||||
$site_url = site_url();
|
||||
@@ -146,15 +147,26 @@ class WPStrava_Settings {
|
||||
<ol>
|
||||
<li>Create your free API Application/Connection here: <a href='%1\$s' target='_blank'>%2\$s</a> using the following information:</li>
|
||||
<ul>
|
||||
<li>Application Name: <strong>%3\$s</strong></li>
|
||||
<li>Website: <strong>%4\$s</strong></li>
|
||||
<li>Application Description: <strong>%5\$s</strong></li>
|
||||
<li>Authorization Callback Domain: <strong>%6\$s</strong></li>
|
||||
<li>App Icon: <strong>upload <a href='%3\$s' target='_blank'>this image</a></strong></li>
|
||||
<li>Application Name: <strong>%4\$s</strong></li>
|
||||
<li>Category: OK to leave at default 'other'</li>
|
||||
<li>Club: OK to leave blank</li>
|
||||
<li>Website: <strong>%5\$s</strong></li>
|
||||
<li>Application Description: <strong>%6\$s</strong></li>
|
||||
<li>Authorization Callback Domain: <strong>%7\$s</strong></li>
|
||||
</ul>
|
||||
<li>Once you've created your API Application at strava.com, enter the <strong>Client ID</strong> and <strong>Client Secret</strong> below, which can now be found on that same strava API Settings page.
|
||||
<li>After saving your Client ID and Secret, you'll be redirected to strava to authorize your API Application. If successful, your Strava Token will display instead of Client ID and Client Secret.</li>
|
||||
<li>If you need to re-authorize your API Application, erase your Strava Token here and click 'Save Changes' to start over.</li>
|
||||
</ol>", 'wp-strava' ), $settings_url, $settings_url, $app_name, $site_url, $description, $site_url );
|
||||
</ol>", 'wp-strava' ),
|
||||
$settings_url,
|
||||
$settings_url,
|
||||
$icon_url,
|
||||
$app_name,
|
||||
$site_url,
|
||||
$description,
|
||||
wp_parse_url( $site_url, PHP_URL_HOST )
|
||||
);
|
||||
}
|
||||
|
||||
public function print_gmaps_instructions() {
|
||||
|
||||
Reference in New Issue
Block a user