summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2018-06-08 10:09:24 -0400
committerAnthony G. Basile <blueness@gentoo.org>2018-06-08 10:09:24 -0400
commita6b006c0f1ef757f23375f7906193370337d8bd7 (patch)
tree4467c6423b2c54e6ef8c3e79241a833fb17833a5 /plugins/jetpack/modules/shortcodes/vr.php
parentUpdate akismet 4.0.7 (diff)
downloadblogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.gz
blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.bz2
blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.zip
Update jetpack 6.2
Diffstat (limited to 'plugins/jetpack/modules/shortcodes/vr.php')
-rw-r--r--plugins/jetpack/modules/shortcodes/vr.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/plugins/jetpack/modules/shortcodes/vr.php b/plugins/jetpack/modules/shortcodes/vr.php
index 15906c70..12835b8a 100644
--- a/plugins/jetpack/modules/shortcodes/vr.php
+++ b/plugins/jetpack/modules/shortcodes/vr.php
@@ -97,7 +97,6 @@ function jetpack_vr_viewer_get_html( $url_params ) {
* @return html - complete vr viewer html
*/
function jetpack_vr_viewer_shortcode( $atts ) {
-
$params = shortcode_atts( array(
0 => null,
'url' => null,
@@ -129,3 +128,29 @@ function jetpack_vr_viewer_shortcode( $atts ) {
}
add_shortcode( 'vr', 'jetpack_vr_viewer_shortcode' );
+
+// Gutenberg!
+add_action( 'admin_init', 'jetpack_register_block_type_vr' );
+function jetpack_register_block_type_vr() {
+ if ( ! function_exists( 'register_block_type' ) ) {
+ return;
+ }
+
+ wp_register_script(
+ 'jetpack_vr_viewer_shortcode_editor_script',
+ Jetpack::get_file_url_for_environment( '_inc/build/shortcodes/js/blocks/vr-block.min.js', 'modules/shortcodes/js/blocks/vr-block.js' ),
+ array( 'wp-blocks', 'wp-element', 'wp-i18n' )
+ );
+
+ wp_register_style(
+ 'jetpack_vr_viewer_shortcode_editor_style',
+ plugins_url( 'modules/shortcodes/css/blocks/vr-block.css', JETPACK__PLUGIN_FILE ),
+ array( 'wp-edit-blocks' )
+ );
+
+ register_block_type( 'jetpack/vr', array(
+ 'editor_script' => 'jetpack_vr_viewer_shortcode_editor_script',
+ 'editor_style' => 'jetpack_vr_viewer_shortcode_editor_style',
+ 'render_callback' => 'jetpack_vr_viewer_shortcode',
+ ) );
+} \ No newline at end of file