mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-11 18:56:18 +09:00
Formatting fixes
This commit is contained in:
@@ -96,7 +96,7 @@ class WPStrava_API {
|
||||
$data = $this->remote_get( $uri, $args );
|
||||
|
||||
// Default to 1 hour of transient cache unless set otherwise.
|
||||
$settings = WPStrava::get_instance()->settings;
|
||||
$settings = WPStrava::get_instance()->settings;
|
||||
$cache_time = $settings->cache_time ? absint( $settings->cache_time ) : HOUR_IN_SECONDS;
|
||||
|
||||
set_transient( $transient_key, $data, $cache_time );
|
||||
|
||||
@@ -67,7 +67,7 @@ class WPStrava_Blocks_Activity implements WPStrava_Blocks_Interface {
|
||||
|
||||
$this->add_script = true;
|
||||
|
||||
$matches = [];
|
||||
$matches = array();
|
||||
preg_match( '/\/activities\/([0-9].*)$/', $attributes['url'], $matches );
|
||||
if ( $matches[1] ) {
|
||||
// Transform from block attributes to shortcode standard.
|
||||
|
||||
@@ -67,7 +67,7 @@ class WPStrava_Blocks_Route implements WPStrava_Blocks_Interface {
|
||||
|
||||
$this->add_script = true;
|
||||
|
||||
$matches = [];
|
||||
$matches = array();
|
||||
preg_match( '/\/routes\/([0-9].*)$/', $attributes['url'], $matches );
|
||||
if ( $matches[1] ) {
|
||||
// Transform from block attributes to shortcode standard.
|
||||
|
||||
@@ -544,8 +544,8 @@ class WPStrava_Settings {
|
||||
$fifteen_min = 15 * MINUTE_IN_SECONDS;
|
||||
?>
|
||||
<select id="strava_cache_time" name="strava_cache_time">
|
||||
<option value="<?php echo esc_attr( HOUR_IN_SECONDS )?>" <?php selected( $this->cache_time, HOUR_IN_SECONDS ); ?>><?php esc_html_e( '1 Hour', 'wp-strava' ); ?></option>
|
||||
<option value="<?php echo esc_attr( $fifteen_min )?>" <?php selected( $this->cache_time, $fifteen_min ); ?>><?php esc_html_e( '15 Minutes', 'wp-strava' ); ?></option>
|
||||
<option value="<?php echo esc_attr( HOUR_IN_SECONDS ); ?>" <?php selected( $this->cache_time, HOUR_IN_SECONDS ); ?>><?php esc_html_e( '1 Hour', 'wp-strava' ); ?></option>
|
||||
<option value="<?php echo esc_attr( $fifteen_min ); ?>" <?php selected( $this->cache_time, $fifteen_min ); ?>><?php esc_html_e( '15 Minutes', 'wp-strava' ); ?></option>
|
||||
</select>
|
||||
<p class="description"><?php esc_html_e( 'How often to refresh data from the Strava API', 'wp-strava' ); ?></p>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user