mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-13 11:46:41 +09:00
Register styles in main plugin
Enqueue styles only if needed
This commit is contained in:
@@ -19,6 +19,8 @@ class WPStrava {
|
||||
|
||||
if ( is_admin() ) {
|
||||
$this->settings->hook();
|
||||
} else {
|
||||
add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
|
||||
}
|
||||
|
||||
// Register StravaLatestRidesWidget widget
|
||||
@@ -66,4 +68,9 @@ class WPStrava {
|
||||
|
||||
return $this->rides;
|
||||
}
|
||||
|
||||
public function register_scripts() {
|
||||
// Register a personalized stylesheet
|
||||
wp_register_style( 'wp-strava-style', WPSTRAVA_PLUGIN_URL . 'css/wp-strava.css' );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user