mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-19 14:44:06 +09:00
Updated documentation and version for 2.0.0
This commit is contained in:
@@ -107,9 +107,9 @@ class WPStrava {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an API object for the given athlete token.
|
||||
* Get an API object for the given Client ID.
|
||||
*
|
||||
* @param string $token Athlete token.
|
||||
* @param string $id Client ID.
|
||||
* @return WPStrava_API
|
||||
*/
|
||||
public function get_api( $id = null ) {
|
||||
|
||||
@@ -155,8 +155,8 @@ class WPStrava_API {
|
||||
return null;
|
||||
}
|
||||
|
||||
$settings = WPStrava::get_instance()->settings;
|
||||
$info = $settings->info;
|
||||
$settings = WPStrava::get_instance()->settings;
|
||||
$info = $settings->info;
|
||||
|
||||
if ( ! empty( $info[ $this->client_id ]->access_token ) ) {
|
||||
return $info[ $this->client_id ]->access_token;
|
||||
|
||||
@@ -60,7 +60,7 @@ class WPStrava_ActivityShortcode {
|
||||
|
||||
if ( isset( $atts['athlete_token'] ) ) {
|
||||
// Translators: Message shown when using deprecated athlete_token parameter.
|
||||
return __( 'The <code>athlete_token</code> parameter is deprecated as of version 2 and should be replaced with <code>client_id</code>.', 'wp-strava' );
|
||||
return __( 'The <code>athlete_token</code> parameter is deprecated as of WP-Strava version 2 and should be replaced with <code>client_id</code>.', 'wp-strava' );
|
||||
}
|
||||
|
||||
/* Make sure boolean values are actually boolean
|
||||
|
||||
@@ -14,7 +14,7 @@ class WPStrava_LatestActivities {
|
||||
|
||||
if ( isset( $args['athlete_token'] ) ) {
|
||||
// Translators: Message shown when using deprecated athlete_token parameter.
|
||||
return __( 'The <code>athlete_token</code> parameter is deprecated as of version 2 and should be replaced with <code>client_id</code>.', 'wp-strava' );
|
||||
return __( 'The <code>athlete_token</code> parameter is deprecated as of WP-Strava version 2 and should be replaced with <code>client_id</code>.', 'wp-strava' );
|
||||
}
|
||||
|
||||
$som = WPStrava_SOM::get_som( $args['som'] );
|
||||
|
||||
@@ -137,7 +137,7 @@ class WPStrava_LatestMapWidget extends WP_Widget {
|
||||
* Get image for specific activity using Static Maps class.
|
||||
*
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @param string $id Athlete Token or Club ID.
|
||||
* @param string $id Client ID or Club ID.
|
||||
* @param object $activity Activity to get image for.
|
||||
* @param boolean $build_new Whether to refresh the image from cache.
|
||||
* @return string Image tag.
|
||||
@@ -158,7 +158,7 @@ class WPStrava_LatestMapWidget extends WP_Widget {
|
||||
*
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @since 1.2.0
|
||||
* @param string $id Athlete Token or Club ID.
|
||||
* @param string $id Client ID or Club ID.
|
||||
* @param string $img Image tag.
|
||||
*/
|
||||
private function update_map( $id, $img ) {
|
||||
@@ -170,7 +170,7 @@ class WPStrava_LatestMapWidget extends WP_Widget {
|
||||
*
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @since 1.2.0
|
||||
* @param string $id Athlete Token or Club ID.
|
||||
* @param string $id Client ID or Club ID.
|
||||
* @param object $activity stdClass Strava activity object.
|
||||
*/
|
||||
private function update_activity( $id, $activity ) {
|
||||
@@ -182,7 +182,7 @@ class WPStrava_LatestMapWidget extends WP_Widget {
|
||||
*
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @since 1.2.0
|
||||
* @param string $id Athlete Token or Club ID.
|
||||
* @param string $id CLient ID or Club ID.
|
||||
* @param object $activity stdClass Strava activity object.
|
||||
*/
|
||||
private function update_activity_transient( $id, $activity ) {
|
||||
|
||||
@@ -60,7 +60,7 @@ class WPStrava_RouteShortcode {
|
||||
|
||||
if ( isset( $atts['athlete_token'] ) ) {
|
||||
// Translators: Message shown when using deprecated athlete_token parameter.
|
||||
return __( 'The <code>athlete_token</code> parameter is deprecated as of version 2 and should be replaced with <code>client_id</code>.', 'wp-strava' );
|
||||
return __( 'The <code>athlete_token</code> parameter is deprecated as of WP-Strava version 2 and should be replaced with <code>client_id</code>.', 'wp-strava' );
|
||||
}
|
||||
|
||||
/* Make sure boolean values are actually boolean
|
||||
|
||||
@@ -215,7 +215,7 @@ class WPStrava_Settings {
|
||||
* Renamed from print_token_input().
|
||||
*
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @since 2.0
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public function print_id_input() {
|
||||
foreach ( $this->get_all_ids() as $id => $nickname ) {
|
||||
@@ -268,7 +268,7 @@ class WPStrava_Settings {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize the nicknames - make sure we've got the same number of nicknames sa tokens.
|
||||
* Sanitize the nicknames - make sure we've got the same number of nicknames sa IDs.
|
||||
*
|
||||
* @param array $nicknames Nicknames for the athletes saved.
|
||||
* @return array
|
||||
@@ -307,7 +307,7 @@ class WPStrava_Settings {
|
||||
*
|
||||
* Renamed from sanitize_token().
|
||||
*
|
||||
* @param string $token
|
||||
* @param string $id Client ID.
|
||||
* @return string
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @since 2.0
|
||||
|
||||
Reference in New Issue
Block a user