Added mapbox / gmaps setting switcher

This commit is contained in:
Justin Foell
2021-12-30 14:06:30 -06:00
parent e1814ccfb6
commit 51cc4b7abe
6 changed files with 225 additions and 47 deletions
+13
View File
@@ -95,6 +95,7 @@ class WPStrava {
if ( is_admin() ) {
$this->settings->hook();
add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
} else { // Front-end.
add_action( 'init', array( $this, 'register_shortcodes' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
@@ -188,6 +189,18 @@ class WPStrava {
return $this->segments;
}
/**
* Register/enqueue admin javascript.
*
* @author Justin Foell <justin@foell.org>
* @since next
*/
public function register_admin_scripts() {
if ( $this->settings->is_settings_page() ) {
wp_enqueue_script( 'strava-admin-settings', WPSTRAVA_PLUGIN_URL . 'src/admin-settings.js', array(), WPSTRAVA_PLUGIN_VERSION, true );
}
}
/**
* Register the wp-strava stylesheet.
*/