This commit is contained in:
Justin Foell
2019-04-01 14:50:36 -05:00
parent 823fff522b
commit 3ce9d26e88
6 changed files with 280 additions and 93 deletions
+9 -1
View File
@@ -16,6 +16,12 @@ class WPStrava {
*/
private $settings = null;
/**
* Authorization object.
* @var WPStrava_Auth
*/
private $auth = null;
/**
* Array of WPStrava_API objects (one for each athlete).
*
@@ -40,9 +46,11 @@ class WPStrava {
*/
private function __construct() {
$this->settings = new WPStrava_Settings();
$this->auth = WPStrava_Auth::get_auth( 'forever' );
if ( is_admin() ) {
$this->settings->hook();
$this->auth->hook();
} else {
add_action( 'init', array( $this, 'register_shortcodes' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
@@ -90,7 +98,7 @@ class WPStrava {
}
/**
* Get an API object for the given athelete token.
* Get an API object for the given athlete token.
*
* @param string $token Athlete token.
* @return WPStrava_API