Browse Source

console loggin

windhamdavid 1 week ago
parent
commit
ffb55ad4d3
2 changed files with 24 additions and 2 deletions
  1. 23 1
      functions.php
  2. 1 1
      js/deny-list-blocks.js

+ 23 - 1
functions.php

@@ -281,4 +281,26 @@ function srh25_deny_list_blocks() {
         true
         true
     );
     );
 }
 }
-add_action('enqueue_block_editor_assets', 'srh25_deny_list_blocks' );
+add_action('enqueue_block_editor_assets', 'srh25_deny_list_blocks' );
+
+
+/***********************************************************
+############### Unregister Patterns ########################
+************************************************************/
+
+function srh25_unregister_patterns() {
+	unregister_block_pattern( 'twentytwentyfive/vertical-header' );
+}
+add_action( 'init', 'srh25_unregister_patterns', 999 );
+
+function srh25_remove_core_patterns() {
+	remove_theme_support( 'core-block-patterns' );
+}
+add_action( 'after_setup_theme', 'srh25_remove_core_patterns' );
+
+
+add_action('wp_default_scripts', function ($scripts) {
+  if (!empty($scripts->registered['jquery'])) {
+    $scripts->registered['jquery']->deps = array_diff($scripts->registered['jquery']->deps, ['jquery-migrate']);
+  }
+});

+ 1 - 1
js/deny-list-blocks.js

@@ -69,7 +69,7 @@ wp.domReady(() => {
     wp.blocks.getBlockVariations('core/embed')?.forEach(variation => {
     wp.blocks.getBlockVariations('core/embed')?.forEach(variation => {
         if (removeEmbeds.includes(variation.name)) {
         if (removeEmbeds.includes(variation.name)) {
             wp.blocks.unregisterBlockVariation('core/embed', variation.name);
             wp.blocks.unregisterBlockVariation('core/embed', variation.name);
-            console.log(`Removed embed variation: ${variation.name}`);
+            //console.log(`Removed embed variation: ${variation.name}`);
         }
         }
     });
     });
 });
 });