mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-13 11:46:41 +09:00
Add route block
This commit is contained in:
+15
-1
@@ -62,6 +62,17 @@ class WPStrava {
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if rest request to skip link rendering in block editor.
|
||||
*
|
||||
* @return boolean
|
||||
* @author Justin Foell <justin@foell.org>
|
||||
* @since 2.6.0
|
||||
*/
|
||||
public static function is_rest_request() {
|
||||
return defined( 'REST_REQUEST' ) && REST_REQUEST;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to install hooks at WP runtime.
|
||||
*
|
||||
@@ -188,7 +199,10 @@ class WPStrava {
|
||||
* @see https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
|
||||
*/
|
||||
public function register_blocks() {
|
||||
static $blocks = array( 'WPStrava_Blocks_Activity' );
|
||||
static $blocks = array(
|
||||
'WPStrava_Blocks_Activity',
|
||||
'WPStrava_Blocks_Route',
|
||||
);
|
||||
|
||||
// automatically load dependencies and version
|
||||
$asset_file = include WPSTRAVA_PLUGIN_DIR . 'build/index.asset.php';
|
||||
|
||||
Reference in New Issue
Block a user