function mdnooz_core_load() { require_once dirname(__FILE__) . '/inc/autoload.php'; $nooz_core = new NoozCore(__FILE__); $nooz_core->title('Nooz'); // todo: consider using an option for nooz version $nooz_core->version('0.12.1'); $nooz_core->set_admin_helper(new AdminHelper()); $nooz_core->set_settings(new Settings()); $array_loader = new Twig_Loader_Array(array()); $file_loader = new Twig_Loader_Filesystem(array(dirname(__FILE__) . '/inc/templates')); $chain_loader = new Twig_Loader_Chain(array($array_loader, $file_loader)); $twig = new Twig_Environment($chain_loader, array('autoescape' => false)); $nooz_core->set_templating(new TwigTemplating($twig, $array_loader)); $nooz_core->register(); $nooz_help = new NoozContextualHelp(__FILE__); $nooz_help->register(); Registry::set('core', $nooz_core); Registry::set('file_loader', $file_loader); do_action('nooz_init'); }
<?php if (!defined('WP_UNINSTALL_PLUGIN')) { status_header(404); exit; } use MightyDev\WordPress\Plugin\NoozCore; require_once dirname(__FILE__) . '/inc/autoload.php'; $nooz_core = new NoozCore(); $nooz_core->uninstall();