I’ve created a block to display a menu in Drupal 9 using code from https://drupal.stackexchange.com/a/277246 but I need to undo it and rework some things. However, no matter what I do, the block remains. I have the following code in a MYTHEME_preprocess_menu function.
$block_manager = Drupal::service('plugin.manager.block'); $config = []; $plugin_block = $block_manager->createInstance('primarynavigation', $config); $render = $plugin_block->build(); $variables['primary_menu'] = render($render);
The idea was to display a different menu programmatically based on field settings of each node. How do I delete this block?