mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-15 20:53:49 +09:00
Added new v3 settings
This commit is contained in:
@@ -26,15 +26,14 @@ class WPStrava {
|
||||
}
|
||||
|
||||
public static function get_instance() {
|
||||
if ( ! self::$instance )
|
||||
self::$instance = new WPStrava();
|
||||
if ( ! self::$instance ) {
|
||||
$class = __CLASS__;
|
||||
self::$instance = new $class();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
public function __get( $name ) {
|
||||
if ( isset( $this->{$name} ) )
|
||||
return $this->{$name};
|
||||
|
||||
//on-demand classes
|
||||
if ( $name == 'api' )
|
||||
return $this->get_api();
|
||||
@@ -42,13 +41,16 @@ class WPStrava {
|
||||
if ( $name == 'rides' )
|
||||
return $this->get_rides();
|
||||
|
||||
if ( isset( $this->{$name} ) )
|
||||
return $this->{$name};
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public function get_api() {
|
||||
if ( ! $this->api ) {
|
||||
require_once WPSTRAVA_PLUGIN_DIR . 'lib/API.class.php';
|
||||
$this->api = new WPStrava_API();
|
||||
$this->api = new WPStrava_API( get_option('strava_token') );
|
||||
}
|
||||
|
||||
return $this->api;
|
||||
|
||||
Reference in New Issue
Block a user