mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-18 06:03:49 +09:00
Load API IDs in Settings constructor
Make sure auth token is correct for Client ID Add a one-time 404 auth_refresh and retry
This commit is contained in:
@@ -16,6 +16,17 @@ class WPStrava_Settings {
|
||||
private $option_page = 'wp-strava-settings-group';
|
||||
private $adding_athlete = true;
|
||||
|
||||
|
||||
/**
|
||||
* Settings constructor.
|
||||
*
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @since 2.0
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->ids = $this->get_ids();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register actions & filters for menus and authentication.
|
||||
*
|
||||
@@ -54,7 +65,6 @@ class WPStrava_Settings {
|
||||
add_settings_section( 'strava_api', __( 'Strava API', 'wp-strava' ), array( $this, 'print_api_instructions' ), 'wp-strava' );
|
||||
|
||||
$this->adding_athlete = $this->is_adding_athlete();
|
||||
$this->ids = $this->get_ids();
|
||||
|
||||
if ( $this->ids_empty( $this->ids ) ) {
|
||||
register_setting( $this->option_page, 'strava_client_id', array( $this, 'sanitize_client_id' ) );
|
||||
|
||||
Reference in New Issue
Block a user