Added transforms for segments

This commit is contained in:
Justin Foell
2021-09-24 10:30:48 -05:00
parent ccf9231c43
commit 22ff8c89ca
2 changed files with 21 additions and 2 deletions
+2 -1
View File
@@ -48,6 +48,7 @@ class WPStrava_Blocks_Segment implements WPStrava_Blocks_Interface {
),
)
);
add_action( 'wp_footer', array( $this, 'print_scripts' ) );
}
@@ -68,7 +69,7 @@ class WPStrava_Blocks_Segment implements WPStrava_Blocks_Interface {
$this->add_script = true;
$matches = array();
preg_match( '/\/segments\/([0-9].*)$/', $attributes['url'], $matches );
preg_match( '#/segments/([0-9].*)$#', $attributes['url'], $matches );
if ( $matches[1] ) {
// Transform from block attributes to shortcode standard.
$atts = array(