<?php

defined('DOLPHY_PLUGIN') or die('Access Denied!');

add_filter('template_include', function ($template) {
  $fileName = basename($template);

  $file = DOLPHY_TEMPLATES_ERRORS."/{$fileName}";
  // Uncomment the line below to enable Dolphy error pages
  // if (is_file($file)) $template = $file;

  return $template;
}, 50000);


add_action('dolphy_error_header', function () {
  include DOLPHY_TEMPLATES_ERRORS.'/includes/header.php';
});

add_action('dolphy_error_footer', function () {
  include DOLPHY_TEMPLATES_ERRORS.'/includes/footer.php';
});
