Cleaned up route skeleton

This commit is contained in:
Justin Foell
2020-01-31 11:47:39 -06:00
parent 5d76785ad8
commit a78ace5476
4 changed files with 0 additions and 76 deletions
-9
View File
@@ -1,9 +0,0 @@
/**
* The following styles get applied inside the editor only.
*
* Replace them with your own styles or remove the file completely.
*/
.wp-block-wp-strava-route {
border: 1px dotted #f00;
}
-56
View File
@@ -1,56 +0,0 @@
<?php
/**
* Functions to register client-side assets (scripts and stylesheets) for the
* Gutenberg block.
*
* @package wp-strava
*/
/**
* Registers all block assets so that they can be enqueued through Gutenberg in
* the corresponding context.
*
* @see https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/applying-styles-with-stylesheets/
*/
function route_block_init() {
// Skip block registration if Gutenberg is not enabled/merged.
if ( ! function_exists( 'register_block_type' ) ) {
return;
}
$dir = dirname( __FILE__ );
$index_js = 'route/index.js';
wp_register_script(
'route-block-editor',
plugins_url( $index_js, __FILE__ ),
array(
'wp-blocks',
'wp-i18n',
'wp-element',
),
filemtime( "$dir/$index_js" )
);
$editor_css = 'route/editor.css';
wp_register_style(
'route-block-editor',
plugins_url( $editor_css, __FILE__ ),
array(),
filemtime( "$dir/$editor_css" )
);
$style_css = 'route/style.css';
wp_register_style(
'route-block',
plugins_url( $style_css, __FILE__ ),
array(),
filemtime( "$dir/$style_css" )
);
register_block_type( 'wp-strava/route', array(
'editor_script' => 'route-block-editor',
'editor_style' => 'route-block-editor',
'style' => 'route-block',
) );
}
add_action( 'init', 'route_block_init' );
-11
View File
@@ -1,11 +0,0 @@
/**
* The following styles get applied both on the front of your site and in the editor.
*
* Replace them with your own styles or remove the file completely.
*/
.wp-block-wp-strava-route {
background-color: #000;
color: #fff;
padding: 2px;
}