From a5149a055f00ca0006eae136f39fbb455ba17db4 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Fri, 17 Nov 2023 11:42:46 +0100 Subject: [PATCH] introducing block editor adjustement script --- index.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/index.php b/index.php index 1f5a179..d2b766c 100644 --- a/index.php +++ b/index.php @@ -133,6 +133,7 @@ function add_type_attribute($tag, $handle, $src) return $tag; } add_filter('script_loader_tag', 'add_type_attribute', 10, 3); + /* --------------------------- ALLOWED BLOCKS ---------------------------*/ @@ -202,3 +203,26 @@ function homegrade_allowed_block_types_all($block_editor_context, $editor_contex POST TYPE TEMPLATES -------------------------------------*/ include_once('templates.php'); + + + + +/* ------------------------------------- + CORE BLOCKS ADJUSTMENTS + -------------------------------------*/ +function enqueue_block_editor_adjustments() +{ + + wp_register_script( + 'block_editor_adjustments', + plugin_dir_url(__FILE__) . 'block_editor_adjustments.js', + ['wp-blocks', 'wp-dom', 'wp-dom-ready', 'wp-edit-post'], + filemtime(plugin_dir_path(__FILE__) . 'block_editor_adjustments.js') + + ); + + wp_enqueue_script('block_editor_adjustments'); +} + + +// add_action('enqueue_block_editor_assets', 'enqueue_block_editor_adjustments');