<?php

// initialize load of must use plugins
if (!defined("INOBY_MU_PLUGINS_LOADED")) {
  if (!file_exists(WPMU_PLUGIN_DIR)) {
    mkdir(WPMU_PLUGIN_DIR, 0755, true);
  }
  $file = fopen(WPMU_PLUGIN_DIR . "/inoby_mu_plugin.php", "w");
  fwrite(
    $file,
    "<?php require_once ABSPATH . \"/wp-content/themes/inoby-theme/plugins/index.php\";",
  );
  fclose($file);

  $current_url = home_url($_SERVER["REQUEST_URI"]); // Get the current URL
  wp_redirect($current_url); // Reload the page
  exit();
}

/**
 * Due to bugs in the 5.5 core release concatenate scripts is causing errors.
 * Because of this we disable it.
 **/
if (is_admin()) {
  add_action("wp_print_scripts", function () {
    global $concatenate_scripts;
    $concatenate_scripts = false;
  });
}
