mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-11 18:56:18 +09:00
Refined responsive table styles
This commit is contained in:
@@ -70,6 +70,10 @@ only screen and (max-width: 760px),
|
||||
content: attr(data-label);
|
||||
}
|
||||
|
||||
.activity-details-table td {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.activity-details-table-info, .activity-details-table-units {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ On the WP-Strava settings page you cannot currently remove and add another athle
|
||||
|
||||
= 2.5.0 =
|
||||
Fix missing translation domain on "Save Changes" in settings. https://wordpress.org/support/topic/small-fix-in-settings-php-function-print_clear_input
|
||||
Refined styles for responsive tables https://wordpress.org/support/topic/responsive-strava-activity-table/
|
||||
|
||||
|
||||
= 2.4.0 =
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
|
||||
class WPStrava_Blocks_Activity implements WPStrava_Blocks_Interface {
|
||||
|
||||
/**
|
||||
* Whether or not to enqueue styles (if shortcode is present).
|
||||
*
|
||||
* @var boolean
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @since 2.5.0
|
||||
*/
|
||||
private $add_script = false;
|
||||
|
||||
/**
|
||||
* Register the wp-strava/activity block.
|
||||
*
|
||||
@@ -21,6 +30,7 @@ class WPStrava_Blocks_Activity implements WPStrava_Blocks_Interface {
|
||||
'render_callback' => array( $this, 'render_block' ),
|
||||
)
|
||||
);
|
||||
add_action( 'wp_footer', array( $this, 'print_scripts' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,6 +47,8 @@ class WPStrava_Blocks_Activity implements WPStrava_Blocks_Interface {
|
||||
return $content;
|
||||
}
|
||||
|
||||
$this->add_script = true;
|
||||
|
||||
$matches = [];
|
||||
preg_match( '/\/activities\/([0-9].*)$/', $attributes['url'], $matches );
|
||||
if ( $matches[1] ) {
|
||||
@@ -52,4 +64,16 @@ class WPStrava_Blocks_Activity implements WPStrava_Blocks_Interface {
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue style if shortcode is being used.
|
||||
*
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public function print_scripts() {
|
||||
if ( $this->add_script ) {
|
||||
wp_enqueue_style( 'wp-strava-style' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user