Browse Source

guten.js for video_meta

windhamdavid 2 months ago
parent
commit
1d28ed4e88
1 changed files with 21 additions and 0 deletions
  1. 21 0
      inc/tweaks.php

+ 21 - 0
inc/tweaks.php

@@ -266,4 +266,25 @@ function dw_video_embed( $attr, $content='' ) {
 add_shortcode( 'video', 'dw_video_embed' );
 
 
+/*************   Gutenberg Editor Stuff ******************/
+
+function dw_guten_fullwidth() {
+     add_theme_support( 'align-wide' );
+}
+add_action( 'after_setup_theme', 'dw_guten_fullwidth' );
+
+function guten_enqueue() {
+    wp_enqueue_script('guten-script', get_template_directory_uri() . '/js/guten.js',
+        array( 'wp-blocks', 'wp-element', 'wp-components' )
+    );
+}
+add_action( 'enqueue_block_editor_assets', 'guten_enqueue' );
+function gutenberg_video_meta_init() {
+    register_meta( 'post', 'media', array(
+        'show_in_rest' => true,
+		'single' => true,
+		'type' => 'string'
+    ) );
+}
+add_action( 'init', 'gutenberg_video_meta_init' );
 ?>